Example #1
0
 def test_add_more_max_clusters(self):
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     in_ = np.array([1])
     out_ = np.array([1])
     is_add = self.base_point_b.add(in_, out_)
     np.testing.assert_array_equal([1], in_)
     np.testing.assert_array_equal([1], out_)
     self.assertEqual(False, is_add)
Example #2
0
 def test_add_all_clusters_modify(self):
     self.base_point_e.clusters.append(cluster_mock.ClusterMockNone())
     self.base_point_e.clusters.append(cluster_mock.ClusterMockNone())
     self.base_point_e.clusters.append(cluster_mock.ClusterMockNone())
     in_ = np.array([1, 0, 0])
     out_ = np.array([1, 0, 0])
     is_add = self.base_point_e.add(in_, out_)
     np.testing.assert_array_equal([1, 0, 0], in_)
     np.testing.assert_array_equal([1, 0, 0], out_)
     self.assertEqual(False, is_add)
     self.assertEqual(len(self.base_point_e.clusters), 3)
Example #3
0
 def test_add_out_not_valid_value(self):
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.assertRaises(ValueError, self.base_point_b.add, np.array([1]),
                       np.array([-1]))
Example #4
0
 def test_add_in_not_valid_len(self):
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.assertRaises(AssertionError, self.base_point_b.add,
                       np.array([1, 1]), np.array([1]))
Example #5
0
 def test_add_in_none(self):
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.assertRaises(ValueError, self.base_point_b.add, None,
                       np.array([1]))
Example #6
0
 def test_back_none(self):
     self.base_point_b.clusters.append(cluster_mock.ClusterMockNone())
     self.assertRaises(ValueError, self.base_point_b.predict_back, None)