anki-connect/tests/test_misc.py

26 lines
622 B
Python
Raw Normal View History

2018-05-07 01:45:56 +00:00
#!/usr/bin/env python
2017-08-29 04:21:32 +00:00
import unittest
2018-05-07 01:45:56 +00:00
import util
2017-08-29 04:21:32 +00:00
2018-05-08 22:18:21 +00:00
class TestMisc(unittest.TestCase):
2018-05-07 03:21:59 +00:00
def runTest(self):
2018-05-08 22:18:21 +00:00
# version
self.assertEqual(util.invoke('version'), 6)
2018-05-07 01:45:56 +00:00
2018-05-08 22:18:21 +00:00
# sync
2018-05-07 02:01:24 +00:00
util.invoke('sync')
2018-05-07 01:45:56 +00:00
2018-05-08 22:18:21 +00:00
# multi
actions = [util.request('version'), util.request('version'), util.request('version')]
results = util.invoke('multi', actions=actions)
self.assertEqual(len(results), len(actions))
for result in results:
self.assertIsNone(result['error'])
self.assertEqual(result['result'], 6)
2018-05-07 01:45:56 +00:00
if __name__ == '__main__':
unittest.main()