Exemple #1
0
 def test_alternativesValue(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[1, 2], [2, 5, 8]])
         tmp.generate_co()
         tmp.rate(np.array([[4, 20], [2, -1]]))
Exemple #2
0
 def test_criteriaFail(self):
     with self.assertRaises(TypeError):
         Comet(["Bad", 0.5, 1])
Exemple #3
0
 def test_lowPreferenceValue(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[2, 3]])
         tmp.generate_co()
         tmp.change_co_preference([0.1, -1])
Exemple #4
0
 def test_alternativesLen(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[2, 3], [2, 3, 4]])
         tmp.generate_co()
         tmp.rate(np.array([[1, 2, 3]]))
Exemple #5
0
 def test_noCoInRate(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[2, 3]])
         tmp.rate(np.asarray([[0.2, 0.3]]))
Exemple #6
0
 def test_noCoInChangePreferenceCo(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[2, 3]])
         tmp.change_co_preference([0.1, 0.2])
Exemple #7
0
 def test_preferenceOptionFail(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[0, 1]])
         tmp.generate_co()
         tmp.rate_co('bad')
Exemple #8
0
 def test_preferenceValueFail(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[0, 1]])
         tmp.generate_co()
         tmp.rate_co(value=8)
Exemple #9
0
 def test_noCoInRateCo(self):
     with self.assertRaises(ValueError):
         tmp = Comet([[2, 3]])
         tmp.rate_co()
Exemple #10
0
 def test_lackOfCriteria(self):
     with self.assertRaises(ValueError):
         Comet([])
Exemple #11
0
 def test_criteriaType(self):
     with self.assertRaises(TypeError):
         Comet((0, 0.5, 1))