stub unit test
This commit is contained in:
parent
32290e4a3e
commit
c06c34c529
1 changed files with 26 additions and 0 deletions
26
tests/test_lib/test_multicall_session.py
Normal file
26
tests/test_lib/test_multicall_session.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import mock
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
|
||||
import koji
|
||||
|
||||
|
||||
class TestNewMultiCall(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self._callMethod = mock.patch('koji.ClientSession._callMethod').start()
|
||||
self.session = koji.ClientSession('FAKE_URL')
|
||||
|
||||
def tearDown(self):
|
||||
mock.patch.stopall()
|
||||
|
||||
def test_basic_multicall(self):
|
||||
with self.session.multicall() as m:
|
||||
ret = {}
|
||||
for i in range(10):
|
||||
ret[i] = m.echo(i)
|
||||
self._callMethod.assert_called_once()
|
||||
self.assertEqual(self._callMethod.call_args[0][0], 'multiCall')
|
||||
print self._callMethod.call_args
|
||||
Loading…
Add table
Add a link
Reference in a new issue