示例#1
0
 def test_delete_fail_non_member(self, make_mock_microclassifier):
     population = Population(max_micros=1)
     mock_microclassifier = make_mock_microclassifier()
     population.insert(mock_microclassifier)
     diff_mock_microclassifier = make_mock_microclassifier()
     with pytest.raises(MemberNotFoundError):
         population.delete(diff_mock_microclassifier)
示例#2
0
 def test_delete_succeed_on_macro(self, make_mock_macroclassifier):
     population = Population(max_micros=2)
     mock_macroclassifier = make_mock_macroclassifier(numerosity=2)
     population.insert(mock_macroclassifier)
     assert population.num_micros == 2
     assert population.num_macros == 1
     population.delete(mock_macroclassifier)
     assert population.num_micros == 1
     assert population.num_macros == 1