From a826daa77fa56afddb4920ae7ff9dec334f6e646 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Thu, 22 Jul 2021 12:34:51 +0300 Subject: Check that child distance from itself is zero Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/computations/slink.py: Check that a child's distance from itself is zero. If not, throw an exception. The children lists are a list of distances of "something" from other "somethings". There is still some need to establish what those "somethings" are, so that the test names can reflect the ideas that are actually being tested for. * tests/unit/computations/test_slink.py: Change the name of the test so that it more closely corresponds to the business logic it is actually testing, and not the mechanics of testing the idea. --- tests/unit/computations/test_slink.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/computations/test_slink.py b/tests/unit/computations/test_slink.py index 816cd2f..1fb7bbb 100644 --- a/tests/unit/computations/test_slink.py +++ b/tests/unit/computations/test_slink.py @@ -35,8 +35,7 @@ class TestSlink(TestCase): with self.assertRaises(LengthError): nearest(lst, 1, 1) - def test_nearest_expects_exception_if_there_is_no_zero_at_childs_list_index_corresponding_to_its_index_in_parent(self): - # I don't like the name of this test. Make the name clearer + def test_nearest_expects_exception_if_distance_of_child_from_itself_is_not_zero(self): for lst in [[[1]], [[1,2],[3,4]], [1,0,0],[0,0,5],[0,3,4], -- cgit v1.2.3