def test_distance_with_one_value_as_string_performs_string_comparison(
         self):
     self.assertEqual(1, distancemetric.distance('a', 5, False))
     self.assertEqual(1, distancemetric.distance(5, 'b', False))
 def test_float_distance(self):
     self.assertEqual(0.345, distancemetric.distance(0.968, 0.623, True))
     self.assertEqual(0.345, distancemetric.distance(0.623, 0.968, True))
 def test_discrete_distance(self):
     self.assertEqual(1, distancemetric.distance('a', 'b', False))
     self.assertEqual(0, distancemetric.distance('a', 'a', False))
 def test_integer_distance(self):
     self.assertEqual(1, distancemetric.distance(2, 1, True))
     self.assertEqual(1, distancemetric.distance(1, 2, True))
Exemplo n.º 5
0
 def test_distance_with_one_value_as_string_performs_string_comparison(self):
     self.assertEqual(1, distancemetric.distance('a', 5, False))
     self.assertEqual(1, distancemetric.distance(5, 'b', False))
Exemplo n.º 6
0
 def test_discrete_distance(self):
     self.assertEqual(1, distancemetric.distance('a', 'b', False))
     self.assertEqual(0, distancemetric.distance('a', 'a', False))
Exemplo n.º 7
0
 def test_float_distance(self):
     self.assertEqual(0.345, distancemetric.distance(0.968, 0.623, True))
     self.assertEqual(0.345, distancemetric.distance(0.623, 0.968, True))
Exemplo n.º 8
0
 def test_integer_distance(self):
     self.assertEqual(1, distancemetric.distance(2, 1, True))
     self.assertEqual(1, distancemetric.distance(1, 2, True))