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-07 02:01:24 +00:00
|
|
|
class TestMisc(unittest.TestCase):
|
2017-08-29 04:21:32 +00:00
|
|
|
def test_version(self):
|
2018-05-07 02:01:24 +00:00
|
|
|
result = util.invoke('version')
|
2018-05-07 01:45:56 +00:00
|
|
|
self.assertEqual(result, 5)
|
|
|
|
|
|
|
|
|
|
|
|
def test_upgrade(self):
|
2018-05-07 02:01:24 +00:00
|
|
|
util.invoke('upgrade')
|
2018-05-07 01:45:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_sync(self):
|
2018-05-07 02:01:24 +00:00
|
|
|
util.invoke('sync')
|
2018-05-07 01:45:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_multi(self):
|
2018-05-07 02:01:24 +00:00
|
|
|
result = util.invoke(
|
2018-05-07 01:45:56 +00:00
|
|
|
'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()
|