unittest
import lib
-import nimcoon
suite "Playing direct links":
test "validate options":
let invalidOptionsList = [
- to_table({"musicOnly": true, "feelingLucky": false, "fullScreen": true, "download": false}),
- to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": true})
+ to_table({"musicOnly": true, "feelingLucky": false, "fullScreen": true, "download": false, "autoPlay": false}),
+ to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": true, "autoPlay": false}),
+ # autoPlay download
+ to_table({"musicOnly": true, "feelingLucky": true, "fullScreen": true, "download": true, "autoPlay": true}),
+ # autoPlay video
+ to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": false, "autoPlay": true}),
]
for invalidOptions in invalidOptionsList:
check(not isValidOptions(invalidOptions))
+
let validOptionsList = [
- to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": false, "download": true}),
- to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": false})
+ to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": false, "download": true, "autoPlay": false}),
+ to_table({"musicOnly": false, "feelingLucky": true, "fullScreen": true, "download": false, "autoPlay": false}),
+ to_table({"musicOnly": true, "feelingLucky": true, "fullScreen": false, "download": false, "autoPlay": true}),
]
for validOptions in validOptionsList:
check(isValidOptions(validOptions))