Skip to content
Snippets Groups Projects
Commit fe9f66f4 authored by Nicolas  MAILLET's avatar Nicolas MAILLET
Browse files

Correcting failing test

parent 445bf5bf
No related tags found
No related merge requests found
Pipeline #
......@@ -78,7 +78,6 @@ class Enzyme:
:param enz_file: location of user file (default: ~/rpg_user.py)
:type enz_file: str
"""
#print(self)
if self.rules != []:
# Comment and first line of the Enzyme
ret = "\n\n\n# User defined enzyme " + self.name + "\nENZ = []\n\n"
......
......@@ -42,25 +42,21 @@ def test_enzyme(tmpdir):
"""Test function
'write_enzyme_in_user_file(self, enz_file=DEFUSERENZFILE)'
"""
'''
fil = tmpdir.join("test.tmp")
output_file = tmpdir.join("test_enzuser.py")
dict_rule = {}
rule_txt = "(D)(E,)"
dict_rule[rule_txt] = False
dict_rule[rule_txt] = True
all_rules = rule.create_rules(dict_rule)
new_enz = enzyme.Enzyme(-1, "fake_enzyme", all_rules)
new_enz.write_enzyme_in_user_file(fil)
# ICI BUG
assert fil.read() == '\n\n\n# User defined enzyme fake_enzyme\nENZ = []\n'\
'\nE_1 = rule.Rule(0, "E", True, 1) # Always cut '\
new_enz.write_enzyme_in_user_file(str(output_file))
assert output_file.read() == '\n\n\n# User defined enzyme fake_enzyme\nENZ = []\n'\
'\nE_1 = rule.Rule(0, "E", False, 1) # Never cut '\
'after E, except...\nD_E_1M1 = rule.Rule(-1, "D", '\
'False, -1) # Never cut after E, preceded by D, '\
'True, -1) # Always cut after E, preceded by D, '\
'except...\nE_1.rules.append(D_E_1M1)\nENZ.append('\
'E_1)\n\nENZYME = enzyme.Enzyme(CPT_ENZ, "fake_enzym'\
'e", ENZ, 0)\n# Add it to available enzymes\nAVAILAB'\
'LE_ENZYMES_USER.append(ENZYME)\nCPT_ENZ += 1\n'
'''
def test_check_enzyme_name():
"""Test function 'check_enzyme_name(name_new_enz, all_name_enz)'."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment