def test_update_json_by_pattern_3(self): line = r'{"name":"ВАЛЕНТИНА\\\\ МЕНЧИКОВА"}' result = Converter.update_json_by_pattern(line) expected = '{"name":"ВАЛЕНТИНА МЕНЧИКОВА"}' self.assertEqual(result, expected, r'incorrect update for pattern \\\\ ')
def test_update_json_by_pattern_1(self): line = r'{"email": "[email protected]\\n"}' result = Converter.update_json_by_pattern(line) expected = '{"email": "*****@*****.**"}' self.assertEqual(result, expected, r'incorrect update for pattern \\n ')
def test_update_json_by_pattern_2(self): line = r'{"name":" ЧУП \\"Самелго-Плюс\\" Сак"}' result = Converter.update_json_by_pattern(line) expected = '{"name":" ЧУП Самелго-Плюс Сак"}' self.assertEqual(result, expected, r'incorrect update for pattern \\" ')
def test_update_json_by_pattern(self): result = Converter.update_json_by_pattern(self.json_load_for_patterns) expected = '{"is ":"false","user_agent":"Mo,zilla/5.0 rv:52.0"}' self.assertEqual(result, expected, 'incorrect default data')