mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-17 12:31:03 +01:00
Add HTTP retries and the possibility to ignore image download errors (#33)
added HTTP retry and --ignoreerrors which ignores image download errors, fix #30
This commit is contained in:
13
main_test.go
13
main_test.go
@@ -114,6 +114,7 @@ const EMPTYPAGE string = `DOCTYPE html>
|
||||
|
||||
const (
|
||||
EMPTYURI string = `https://www.kleinanzeigen.de/s-anzeige/empty/1`
|
||||
INVALID503URI string = `https://www.kleinanzeigen.de/s-anzeige/503/1`
|
||||
INVALIDPATHURI string = `https://www.kleinanzeigen.de/anzeige/name/1`
|
||||
INVALID404URI string = `https://www.kleinanzeigen.de/anzeige/name/1/foo/bar`
|
||||
INVALIDURI string = `https://foo.bar/weird/things`
|
||||
@@ -228,6 +229,12 @@ var invalidtests = []Tests{
|
||||
expect: "error loading config file",
|
||||
exitcode: 1,
|
||||
},
|
||||
{
|
||||
name: "503",
|
||||
args: base + " " + INVALID503URI,
|
||||
expect: "could not get page via HTTP",
|
||||
exitcode: 1,
|
||||
},
|
||||
}
|
||||
|
||||
type AdConfig struct {
|
||||
@@ -410,6 +417,12 @@ func InitInvalidSources() []Adsource {
|
||||
content: GetTemplate(nil, empty, "<html>HTTP 404: /eine-anzeige/ does not exist!</html>"),
|
||||
status: 404,
|
||||
},
|
||||
{
|
||||
// valid ad page but 503
|
||||
uri: fmt.Sprintf("%s/s-anzeige/503/1", Baseuri),
|
||||
content: GetTemplate(nil, empty, "<html>HTTP 503: service unavailable</html>"),
|
||||
status: 503,
|
||||
},
|
||||
}
|
||||
|
||||
return ads
|
||||
|
||||
Reference in New Issue
Block a user