Beispiel #1
0
 def test_cross_14(self):
     test_mf1 = {1: 0.2, 2: 0.34, 3: 0.65}
     test_mf2 = {1: 2, 2: 5, 3: 7}
     self.assertRaises(ValueError, lambda: cross(test_mf1, test_mf2))
Beispiel #2
0
 def test_cross_16(self):
     test_mf1 = {1: 0.5, 2: 0.1, 3: 0.5, 4: 0.9}
     test_mf2 = {1: 0.2, 2: 0.3, 3: 0.8, 4: 0.7}
     self.assertEqual(0.3, cross(test_mf1, test_mf2))
Beispiel #3
0
 def test_cross_1(self):
     test_mf1 = [0.3, 0.4, 0.9, 0.2]
     test_mf2 = {1: 0.2, 2: 0.5}
     self.assertRaises(TypeError, lambda: cross(test_mf1, test_mf2))
Beispiel #4
0
 def test_cross_13(self):
     test_mf1 = {1: 0.2, 2: 0.34, 3: 0.65}
     test_mf2 = {1: '0.2', 2: '0.5', 3: '0.76'}
     self.assertRaises(TypeError, lambda: cross(test_mf1, test_mf2))
Beispiel #5
0
 def test_cross_11(self):
     test_mf1 = {1: 0.2, 2: 0.34, 3: 0.65}
     test_mf2 = {'1': 0.2, '2': 0.5, '3': 0.76}
     self.assertRaises(TypeError, lambda: cross(test_mf1, test_mf2))
Beispiel #6
0
 def test_cross_12(self):
     test_mf1 = {1: 0.2, 2: 0.34, 3: 0.65}
     test_mf2 = {1: [0.2], 2: [0.5], 3: [0.76]}
     self.assertRaises(TypeError, lambda: cross(test_mf1, test_mf2))
Beispiel #7
0
 def test_cross_10(self):
     test_mf1 = {1: 0.2, 2: 0.34, 3: 0.65}
     test_mf2 = {1.0: 0.2, 2.0: 0.5, 3.0: 0.76}
     self.assertRaises(TypeError, lambda: cross(test_mf1, test_mf2))
Beispiel #8
0
 def test_cross_4(self):
     test_mf1 = {1: 0.2, 2: 0.5}
     test_mf2 = {}
     self.assertRaises(ValueError, lambda: cross(test_mf1, test_mf2))
Beispiel #9
0
 def test_cross_19(self):
     test_mf1 = {1: 0.0005, 2: 0.34, 3: 0.9999}
     test_mf2 = {1: 0.9995, 2: 0.66, 3: 0.0001}
     self.assertEqual(0.66, cross(test_mf1, test_mf2))
Beispiel #10
0
 def test_cross_18(self):
     test_mf1 = {1: 0.1, 2: 0.7, 3: 0.4}
     test_mf2 = {1: 0.9, 2: 0.2, 3: 0.5}
     self.assertEqual(0.5, cross(test_mf1, test_mf2))
Beispiel #11
0
 def test_cross_17(self):
     test_mf1 = {1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0, 5: 0.0}
     test_mf2 = {1: 0.5, 2: 0.1, 3: 0.5, 4: 0.9, 5: 0.2}
     self.assertEqual(0.1, cross(test_mf1, test_mf2))