2017-09-18 10:07:21 +00:00
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
import testlib
|
|
|
|
import id_allocation
|
|
|
|
|
|
|
|
|
2017-10-01 10:00:43 +00:00
|
|
|
class SlaveTest(testlib.RouterMixin, testlib.TestCase):
|
2017-09-18 10:07:21 +00:00
|
|
|
def test_slave_allocates_id(self):
|
|
|
|
context = self.router.local()
|
|
|
|
id_ = context.call(id_allocation.allocate_an_id)
|
|
|
|
assert id_ == (self.router.id_allocator.next_id - 1)
|
2017-10-01 10:00:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|