From 5bd10be1a908fe3e8c794647a029ed6100d71db3 Mon Sep 17 00:00:00 2001 From: annoviko Date: Thu, 28 Nov 2019 22:23:49 +0100 Subject: [PATCH] #569: [pyclustering.cluster.birch] unit-tests are added. --- pyclustering/cluster/tests/unit/ut_birch.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyclustering/cluster/tests/unit/ut_birch.py b/pyclustering/cluster/tests/unit/ut_birch.py index 664756bd..384bcb4e 100755 --- a/pyclustering/cluster/tests/unit/ut_birch.py +++ b/pyclustering/cluster/tests/unit/ut_birch.py @@ -50,7 +50,14 @@ def templateClusterAllocation(self, path, cluster_sizes, number_clusters, branch birch_instance.process() clusters = birch_instance.get_clusters() + cf_clusters = birch_instance.get_cf_cluster() + cf_entries = birch_instance.get_cf_entries() + self.assertEqual(birch_instance.get_cluster_encoding(), type_encoding.CLUSTER_INDEX_LIST_SEPARATION) + self.assertEqual(number_clusters, len(clusters)) + self.assertEqual(number_clusters, len(cf_clusters)) + self.assertGreater(len(cf_entries), 0) + self.assertLessEqual(len(cf_entries), entry_size_limit) obtained_cluster_sizes = [len(cluster) for cluster in clusters]