def test_already_cleaned_returns_cleaned_value(self): i = '{}' expected = '{}' actual = clean(i) self.assertEqual(expected, actual)
def test_removes_bangs_and_garbage(self): i = '{{<a!>},{<a!>},{<a!>},{<ab>}}' expected = '{{}}' actual = clean(i) self.assertEqual(expected, actual)
def test_removes_bangs_appropriately(self): i = '{{<!!>},{<!!>},{<!!>},{<!!>}}' expected = '{{}{}{}{}}' actual = clean(i) self.assertEqual(expected, actual)
def test_removes_nested_garbage_and_retrains_groups(self): i = '{{<ab>},{<ab>},{<ab>},{<ab>}}' expected = '{{}{}{}{}}' actual = clean(i) self.assertEqual(expected, actual)
def test_removes_all_garbage(self): i = '{<a>,<a>,<a>,<a>}' expected = '{}' actual = clean(i) self.assertEqual(expected, actual)
def test_complex_removed_commas(self): i = '{{{},{},{{}}}}' expected = '{{{}{}{{}}}}' actual = clean(i) self.assertEqual(expected, actual)