def test_fails_when_calculated_gap_is_larger_than_maximum_allowed(self): try: result = ParallelPlatformer.calculate_gap(number_blocks=1, length=11, block_size=1) self.assertTrue(False) except AssertionError as e: self.assertEqual(e.message, 'Gap too wide')
def test_calculate_gap_of_value_one(self): result = ParallelPlatformer.calculate_gap(number_blocks=3, length=13, block_size=3) self.assertEqual(1, result)
def test_fails_when_calculated_gap_is_not_integer(self): try: result = ParallelPlatformer.calculate_gap(number_blocks=3, length=12, block_size=3) self.assertTrue(False) except AssertionError as e: self.assertEqual(e.message, 'Gap size must be a whole number')
def test_calculate_gap_of_value_zero_with_block_size_larger_than_one(self): result = ParallelPlatformer.calculate_gap(number_blocks=4, length=12, block_size=3) self.assertEqual(0, result)