Skip to content
Snippets Groups Projects
Commit dc3aff83 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

added `IDAllocator`

parent bab826ba
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,11 @@ class TestConcurrent(unittest.TestCase): ...@@ -23,6 +23,11 @@ class TestConcurrent(unittest.TestCase):
id_alloc.mark_as_free(y) id_alloc.mark_as_free(y)
id_alloc.mark_as_allocated(y) id_alloc.mark_as_allocated(y)
for i in range(100):
x.add(id_alloc.allocate_int())
self.assertEqual(x, set(unique(x)))
def test_atomic_number_timeout(self): def test_atomic_number_timeout(self):
"""Test comparison while the lock is held all the time""" """Test comparison while the lock is held all the time"""
a = AtomicNumber(2) a = AtomicNumber(2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment