anki-connect/tests/test_misc.py
2018-05-07 14:34:41 -07:00

41 lines
852 B
Python
Executable File

#!/usr/bin/env python
import unittest
import util
class TestVersion(unittest.TestCase):
def runTest(self):
self.assertEqual(util.invoke('version'), 5)
class TestUpgrade(unittest.TestCase):
def runTest(self):
util.invoke('upgrade')
class TestSync(unittest.TestCase):
def runTest(self):
util.invoke('sync')
class TestMulti(unittest.TestCase):
def runTest(self):
result = util.invoke(
'multi',
actions=[
util.request('version'),
util.request('version'),
util.request('version')
]
)
self.assertEqual(len(result), 3)
for response in result:
self.assertIsNone(response['error'])
self.assertEqual(response['result'], 5)
if __name__ == '__main__':
unittest.main()