def test_pipecutting_09(self): requests = [1.3, 1.2, 0.15, 0.2, 0.5, 0.6] stock_length = 2 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 2, "Expected 2 pipes, got %d" % result)
def test_pipecutting_10(self): requests = [1, 1, 1.05] stock_length = 3 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 2, "Expected 2 pipes, got %d" % result)
def test_pipecutting_08(self): requests = [10, 9, 8, 7, 6, 5] stock_length = 10 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 6, "Expected 6 pipes, got %d" % result)
def test_pipecutting_07(self): requests = [1, 2, 3, 4] stock_length = 10 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 1, "Expected 1 pipe, got %d" % result)
def test_pipecutting_05(self): requests = [5, 6, 7, 8, 1, 2, 3, 4, 5, 9] stock_length = 10 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 5, "Expected 5 pipes, got %d" % result)
def test_pipecutting_04(self): requests = [4, 3, 4, 1, 7, 8] stock_length = 10 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 3, "Expected 3 pipes, got %d" % result)
def test_pipecutting_01(self): requests = [] stock_length = 8 result = quiz.pipe_cutting(requests, stock_length) self.assertIsInstance(result, int, "Expected a result of type int, got %s" % result) self.assertEqual(result, 0, "Expected 0 pipes, got %d" % result)