def test_form_sequence_forwards_5(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) cl2 = Classifier(condition="11111111", action=1, effect="0000000", cfg=cfg) gs.forward_classifiers = [ ClassifiersList(cl0), ClassifiersList(cl0, cl1) ] i = 2 idx = 0 # when seq = gs._form_sequence_forwards(i, idx, cl2) # then assert len(seq) == 3 assert cl0.action in seq assert cl1.action in seq assert cl2.action in seq assert seq == [cl1.action, cl0.action, cl2.action]
def test_form_sequence_forwards_1(self, cfg): # given gs = GoalSequenceSearcher() cl0 = Classifier(condition="01010101", action=2, effect="0000000", cfg=cfg) i = 0 idx = 0 # when seq = gs._form_sequence_forwards(i, idx, cl0) # then assert len(seq) == 1 assert cl0.action in seq