示例#1
0
 def test_duplicate_fail_non_member(self, make_mock_microclassifier):
     population = Population(max_micros=2)
     mock_microclassifier = make_mock_microclassifier()
     diff_mock_microclassifier = make_mock_microclassifier()
     population.insert(mock_microclassifier)
     with pytest.raises(MemberNotFoundError):
         population.duplicate(diff_mock_microclassifier, num_copies=1)
     assert population.num_micros == 1
     assert population.num_macros == 1
示例#2
0
 def test_duplicate_two_copies(self, mock_microclassifier):
     population = Population(max_micros=3)
     population.insert(mock_microclassifier)
     population.duplicate(mock_microclassifier, num_copies=2)
     assert population.num_micros == 3
     assert population.num_macros == 1
示例#3
0
 def test_duplicate_single_copy(self, mock_microclassifier):
     population = Population(max_micros=2)
     population.insert(mock_microclassifier)
     population.duplicate(mock_microclassifier, num_copies=1)
     assert population.num_micros == 2
     assert population.num_macros == 1