def test_replace_variable_comment(self): FIXTURE = " x = 'y' ! comment \n" RESULT = " x = 'z' ! comment \n" text = nml.replace(FIXTURE, {"x": "z"}) self.assertEqual(text, RESULT)
def test_replace_variable_no_space(self): FIXTURE = " x='y' \n" RESULT = " x='z' \n" text = nml.replace(FIXTURE, {"x": "z"}) self.assertEqual(text, RESULT)
def test_multiline_variable_replace(self): # As a result of a code review FIXTURE = " x = 1, \n 2" RESULT = " x = 3, \n 4" text = nml.replace(FIXTURE, {"x": [3, 4]}) self.assertEqual(text, RESULT)