瀏覽代碼

test: [utils] add TestSource.test_to_json

main
Rob Hallam 2 月之前
父節點
當前提交
35d25c6ff2
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      test/test_utils.py

+ 4
- 0
test/test_utils.py 查看文件

@@ -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):


Loading…
取消
儲存