mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
test: formatname platform tests
This commit is contained in:
parent
d1e8c34a6e
commit
07deb1baa5
@ -1,3 +1,4 @@
|
||||
import platform
|
||||
import unittest
|
||||
|
||||
from svtplay_dl.service import Service
|
||||
@ -315,6 +316,9 @@ class formatnameTest2(unittest.TestCase):
|
||||
config = setup_defaults()
|
||||
config.set("output", "/tmp")
|
||||
service = Service(config, "http://localhost")
|
||||
if platform.system() == "Windows":
|
||||
assert formatname(service.output, config) == "/tmp.mp4"
|
||||
else:
|
||||
assert formatname(service.output, config) == "/tmp/-service.mp4"
|
||||
|
||||
def test_formatnameBasedir(self):
|
||||
@ -340,6 +344,9 @@ class formatnameTest2(unittest.TestCase):
|
||||
service.output["title"] = "kalle"
|
||||
service.output["season"] = 2
|
||||
service.output["episode"] = 2
|
||||
if platform.system() == "Windows":
|
||||
assert formatname(service.output, config) == r"kalle\kalle.s02e02-service.mp4"
|
||||
else:
|
||||
assert formatname(service.output, config) == "kalle/kalle.s02e02-service.mp4"
|
||||
|
||||
def test_formatnameTvshowSubfolderMovie(self):
|
||||
@ -350,13 +357,22 @@ class formatnameTest2(unittest.TestCase):
|
||||
service.output["title"] = "kalle"
|
||||
service.output["season"] = 2
|
||||
service.output["episode"] = 2
|
||||
if platform.system() == "Windows":
|
||||
assert formatname(service.output, config) == r"movies\kalle.s02e02-service.mp4"
|
||||
else:
|
||||
assert formatname(service.output, config) == "movies/kalle.s02e02-service.mp4"
|
||||
|
||||
def test_formatnameTvshowPath(self):
|
||||
config = setup_defaults()
|
||||
if platform.system() == "Windows":
|
||||
config.set("path", "c:")
|
||||
else:
|
||||
config.set("path", "/tmp")
|
||||
service = Service(config, "http://localhost")
|
||||
service.output["title"] = "kalle"
|
||||
service.output["season"] = 2
|
||||
service.output["episode"] = 2
|
||||
if platform.system() == "Windows":
|
||||
assert formatname(service.output, config) == r"c:kalle.s02e02-service.mp4"
|
||||
else:
|
||||
assert formatname(service.output, config) == "/tmp/kalle.s02e02-service.mp4"
|
||||
|
Loading…
Reference in New Issue
Block a user