Пример #1
0
 def test_allocator_quad_sets(self):
     indexSets = [set([4]), set([3, 2]), set([1, 2]), set([1, 2, 3, 4])]
     allocator = Allocator(indexSets)
     assert len(allocator.slots) == 5
     allocation = allocator.allocate()
     print(allocator.report())
     self.validate_allocation(indexSets, allocation)
Пример #2
0
 def test_allocator_triple_sets(self):
     indexSets = [set([3, 1, 4]), set([3, 2, 1]), set([1]), set([0, 1])]
     allocator = Allocator(indexSets)
     assert len(allocator.slots) == 5
     allocation = allocator.allocate()
     print(allocator.report())
     self.validate_allocation(indexSets, allocation)
Пример #3
0
 def test_allocator_single_sets(self):
     indexSets = [set([3]), set([2]), set([1]), set([0])]
     allocator = Allocator(indexSets)
     assert len(allocator.slots) == 4
     allocation = allocator.allocate()
     print(allocator.report())
     self.validate_allocation(indexSets, allocation)
Пример #4
0
def test_allocator_quad_sets():
    """
  Test allocation with quadruple sets
  """
    indexSets = [set([4]), set([3, 2]), set([1, 2]), set([1, 2, 3, 4])]
    allocator = Allocator(indexSets)
    assert len(allocator.slots) == 5
    allocation = allocator.allocate()
    LOGGER.info(allocator.report())
    validate_allocation(indexSets, allocation)
Пример #5
0
def test_allocator_triple_sets():
    """
  Test allocation with triple sets
  """
    indexSets = [set([3, 1, 4]), set([3, 2, 1]), set([1]), set([0, 1])]
    allocator = Allocator(indexSets)
    assert len(allocator.slots) == 5
    allocation = allocator.allocate()
    LOGGER.info(allocator.report())
    validate_allocation(indexSets, allocation)
Пример #6
0
def test_allocator_single_sets():
    """
  Test allocation with single sets
  """
    indexSets = [set([3]), set([2]), set([1]), set([0])]
    allocator = Allocator(indexSets)
    assert len(allocator.slots) == 4
    allocation = allocator.allocate()
    LOGGER.info(allocator.report())
    validate_allocation(indexSets, allocation)
Пример #7
0
 def test_allocator_octa_sets(self):
     indexSets = [
         set([0, 1, 2, 3]),
         set([0, 1, 2, 3]),
         set([0, 1, 2, 3]),
         set([0, 1, 2, 3, 4, 5, 6, 7])
     ]
     allocator = Allocator(indexSets)
     assert len(allocator.slots) == 8
     allocation = allocator.allocate()
     print(allocator.report())
     self.validate_allocation(indexSets, allocation)
Пример #8
0
def test_allocator_octa_sets():
    """
  Test allocation with sets of 8
  """
    indexSets = [
        set([0, 1, 2, 3]),
        set([0, 1, 2, 3]),
        set([0, 1, 2, 3]),
        set([0, 1, 2, 3, 4, 5, 6, 7])
    ]
    allocator = Allocator(indexSets)
    assert len(allocator.slots) == 8
    allocation = allocator.allocate()
    LOGGER.info(allocator.report())
    validate_allocation(indexSets, allocation)