def test_form_new_classifiers_1(self, cfg): # given gs = GoalSequenceSearcher() cls_list = [ClassifiersList()] cl = Classifier(condition="01010101", action=2, effect="0000000", cfg=cfg) i = 0 # when new_classifiers = gs._form_new_classifiers(cls_list, i, cl) # then assert len(new_classifiers) == 1 assert cl in new_classifiers
def test_form_new_classifiers_2(self, cfg): # given gs = GoalSequenceSearcher() cl0 = Classifier(condition="01010101", action=2, effect="0000000", cfg=cfg) cl1 = Classifier(condition="11111111", action=0, effect="0000000", cfg=cfg) cls_list = [ClassifiersList(cl0)] i = 1 # when new_classifiers = gs._form_new_classifiers(cls_list, i, cl1) # then assert len(new_classifiers) == 2 assert cl0 in new_classifiers assert cl1 in new_classifiers