mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 12:52:38 +01:00
* Refactor xpath scraper code * Make post-process a list * Add map post-process action * Add fixed xpath values * Refactor scrapers into cache * Refactor into mapped config * Trim test html
31 lines
547 B
Go
31 lines
547 B
Go
package scraper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
func TestInvalidPostProcessAction(t *testing.T) {
|
|
yamlStr := `name: Test
|
|
performerByURL:
|
|
- action: scrapeXPath
|
|
scraper: performerScraper
|
|
xPathScrapers:
|
|
performerScraper:
|
|
performer:
|
|
Name:
|
|
selector: //div/a/@href
|
|
postProcess:
|
|
- parseDate: Jan 2, 2006
|
|
- anything
|
|
`
|
|
|
|
c := &config{}
|
|
err := yaml.Unmarshal([]byte(yamlStr), &c)
|
|
|
|
if err == nil {
|
|
t.Error("expected error unmarshalling with invalid post-process action")
|
|
return
|
|
}
|
|
}
|