예제 #1
0
 def test_redistribute_increase_by_one_overflow(self):
     self.assertEqual(memory_distribution_step([5, 1, 1, 1]), [1, 3, 2, 2])
예제 #2
0
 def test_redistribute_start_on_arbitraty_position(self):
     self.assertEqual(memory_distribution_step([0, 1, 0]), [0, 0, 1])
예제 #3
0
 def test_redistribute_increase_by_one(self):
     self.assertEqual(memory_distribution_step([2, 1, 1, 1]), [0, 2, 2, 1])
예제 #4
0
 def test_redistribute_more_blocks_to_empty_banks(self):
     self.assertEqual(memory_distribution_step([2, 0, 0, 0]), [0, 1, 1, 0])
예제 #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])
예제 #6
0
 def test_redistribution_one_bank_is_the_same(self):
     self.assertEqual(memory_distribution_step([5]), [5])
예제 #7
0
 def test_redistribution_of_empty_memory_is_empty(self):
     self.assertEqual(memory_distribution_step([]), [])