Browse Source

test: [utils] add TestSource.test_to_json

main
Rob Hallam 3 months ago
parent
commit
35d25c6ff2
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      test/test_utils.py

+ 4
- 0
test/test_utils.py View File

@@ -44,6 +44,10 @@ class TestSource(unittest.TestCase):
source = utils.Source(self.source, self.path, self.provider) source = utils.Source(self.source, self.path, self.provider)
self.assertEqual(source.duration(), self._duration) 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 # Sad path tests
def test_init_no_source(self): def test_init_no_source(self):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):


Loading…
Cancel
Save