Esempio n. 1
0
 def test_image_maxproduct_13(self):
     R = {1: [0.2, 0.4, 0.5], 2: [0.4, 0.8, 0.1], 3: [0.5, 0.1, 1]}
     A = {1: 1, 2: 0.5, 3: 0}
     result = {1: 0.2, 2: 0.4, 3: 0.5}
     self.assertEqual(image_maxproduct.image_maxproduct(R, A), result)
Esempio n. 2
0
 def test_image_maxproduct_9(self):
     R = {1:1}
     A = {1:0}
     result = {1:0}
     self.assertEqual(image_maxproduct.image_maxproduct(R, A), result)
Esempio n. 3
0
 def test_image_maxproduct_1(self):
     A = [1, 2, 3] # list is not a dictionary
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 4
0
 def test_image_maxproduct_7(self):
     R , A = {1: [0.2], 2: [0.2], 3: [0.1]}
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 5
0
 def test_image_maxproduct_8(self):
     R , A = {1: 2, 2: 3.5, 3: -1}
     self.assertRaises(ValueError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 6
0
 def test_image_maxproduct_6(self):
     A , R = {1: '0.1', 2: '0.2', 3: '0.3'}
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 7
0
 def test_image_maxproduct_5(self):
     A , R = {1.0: 0.1, 2.0: 0.2, 3.0: 0.3}
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 8
0
 def test_image_maxproduct_4(self):
     A , R = {}
     self.assertRaises(ValueError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 9
0
 def test_image_maxproduct_3(self):
     R , A = 0.1
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))
Esempio n. 10
0
 def test_image_maxproduct_2(self):
     A = [[1], [2], [3]]
     B = [1:2,12:13,15:16]
     self.assertRaises(TypeError, lambda: image_maxproduct.image_maxproduct(R, A))