Exemplo n.º 1
0
 def test_redistribute_increase_by_one_overflow(self):
     self.assertEqual(memory_distribution_step([5, 1, 1, 1]), [1, 3, 2, 2])
Exemplo n.º 2
0
 def test_redistribute_start_on_arbitraty_position(self):
     self.assertEqual(memory_distribution_step([0, 1, 0]), [0, 0, 1])
Exemplo n.º 3
0
 def test_redistribute_increase_by_one(self):
     self.assertEqual(memory_distribution_step([2, 1, 1, 1]), [0, 2, 2, 1])
Exemplo n.º 4
0
 def test_redistribute_more_blocks_to_empty_banks(self):
     self.assertEqual(memory_distribution_step([2, 0, 0, 0]), [0, 1, 1, 0])
Exemplo n.º 5
0
 def test_redistribution_of_1_to_other(self):
     self.assertEqual(memory_distribution_step([1, 0]), [0, 1])
     self.assertEqual(memory_distribution_step([1, 0, 0]), [0, 1, 0])
Exemplo n.º 6
0
 def test_redistribution_one_bank_is_the_same(self):
     self.assertEqual(memory_distribution_step([5]), [5])
Exemplo n.º 7
0
 def test_redistribution_of_empty_memory_is_empty(self):
     self.assertEqual(memory_distribution_step([]), [])