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