unit test cleanup for misc

This commit is contained in:
Alex Yatskov 2018-05-08 15:18:21 -07:00
parent ba42cedf1a
commit a7a03ab1b9

View File

@ -4,36 +4,24 @@ import unittest
import util import util
class TestVersion(unittest.TestCase): class TestMisc(unittest.TestCase):
def runTest(self): def runTest(self):
# version
self.assertEqual(util.invoke('version'), 5) self.assertEqual(util.invoke('version'), 5)
# upgrade
class TestUpgrade(unittest.TestCase):
def runTest(self):
util.invoke('upgrade') util.invoke('upgrade')
# sync
class TestSync(unittest.TestCase):
def runTest(self):
util.invoke('sync') util.invoke('sync')
# multi
class TestMulti(unittest.TestCase): actions = [util.request('version'), util.request('version'), util.request('version')]
def runTest(self): results = util.invoke('multi', actions=actions)
result = util.invoke( self.assertEqual(len(results), len(actions))
'multi', for result in results:
actions=[ self.assertIsNone(result['error'])
util.request('version'), self.assertEqual(result['result'], 5)
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__': if __name__ == '__main__':