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