def test_impart_taxa(): # Imparting a knowledge decreases the learning cost of the corresponding taxa, but has no # effect whatsoever on the selected programs. dbf = ProgramFilter(db) dbf.impart_taxa({"flow/conditional"}) print(dbf.selected_programs) assert dbf.selected_programs == { "assignment.py", "collatz.py", "fizzbuzz.py", "is_even.py", }
def test_impart_taxa(): dbf = ProgramFilter(db) taxa = ["O/J", "X/S/M/L", "non/existing/taxon"] dbf.impart_taxa(taxa) print(sorted(dbf.imparted_knowledge)) assert dbf.imparted_knowledge == { "O", "O/J", "X", "X/S", "X/S/M", "X/S/M/L", "non", "non/existing", "non/existing/taxon", }