예제 #1
0
 def test_negative_ones(self):
     self.assertEqual(utils.multiply(-1, -1), 1)
예제 #2
0
 def test_to_multiply_tuple(self):
     with self.assertRaises(TypeError):
         utils.multiply((1, 2), (3, 4))
예제 #3
0
 def test_ones(self):
     self.assertEqual(utils.multiply(1, 1), 1)
예제 #4
0
 def test_to_multiply_two_string(self):
     with self.assertRaises(TypeError):
         utils.multiply("2", "2")
예제 #5
0
 def test_to_multiply_string_and_int(self):
     with self.assertRaises(TypeError):
         utils.multiply("2", 2)
예제 #6
0
 def test_to_multiply_empty(self):
     with self.assertRaises(TypeError):
         utils.multiply()
예제 #7
0
 def test_multiply_range(self):
     self.assertEqual(utils.multiply(1, 2, 3, 4), 24)
예제 #8
0
 def test_multiply_same(self):
     self.assertEqual(utils.multiply(2, 2), 4)
예제 #9
0
 def test_one_multiply_by_2(self):
     self.assertEqual(utils.multiply(1, 2), 2)
예제 #10
0
 def test_float_ones(self):
     self.assertEqual(utils.multiply(1.0, 1.0), 1.0)