def test_non_string_input(self): inp = 1 res = ut.slugify(inp) ref = 1 self.assertEqual(res, ref)
def test_custom_separator(self): inp = 'some string' res = ut.slugify(inp, sep='!') ref = 'some!string' self.assertEqual(res, ref)
def test_leading_trailing_junk(self): inp = ' this string had leading and trailing space ' res = ut.slugify(inp) ref = 'this_string_had_leading_and_trailing_space' self.assertEqual(res, ref)
def test_multiple_adjacent_separators(self): inp = 'this string had extra spaces' res = ut.slugify(inp) ref = 'this_string_had_extra_spaces' self.assertEqual(res, ref)
def test_basic(self): inp = 'Some string 1' res = ut.slugify(inp) ref = 'Some_string_1' self.assertEqual(res, ref)