Pārlūkot izejas kodu

test: [utils] add TestSource.test_to_json

main
Rob Hallam pirms 3 mēnešiem
vecāks
revīzija
35d25c6ff2
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. +4
    -0
      test/test_utils.py

+ 4
- 0
test/test_utils.py Parādīt failu

@@ -44,6 +44,10 @@ class TestSource(unittest.TestCase):
source = utils.Source(self.source, self.path, self.provider)
self.assertEqual(source.duration(), self._duration)

def test_to_json(self):
source = utils.Source(self.source, self.path, self.provider)
self.assertEqual(source.to_json(), {"source": self.source, "path": self.path, "provider": self.provider})

# Sad path tests
def test_init_no_source(self):
with self.assertRaises(ValueError):


Notiek ielāde…
Atcelt
Saglabāt