Skip to content

Commit

Permalink
#569: [pyclustering.cluster.birch] unit-tests are added.
Browse files Browse the repository at this point in the history
  • Loading branch information
annoviko committed Nov 28, 2019
1 parent 4b06385 commit 5bd10be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyclustering/cluster/tests/unit/ut_birch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 5bd10be

Please sign in to comment.