stash/pkg/scraper/mapped_test.go
WithoutPants 2b9215702e
Refactor xpath scraper code. Add fixed and map (#616)
* 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
2020-07-21 14:06:25 +10:00

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
}
}