Ejemplo n.º 1
0
 def test_non_string_input(self):
     inp = 1
     res = ut.slugify(inp)
     ref = 1
     self.assertEqual(res, ref)
Ejemplo n.º 2
0
 def test_custom_separator(self):
     inp = 'some string'
     res = ut.slugify(inp, sep='!')
     ref = 'some!string'
     self.assertEqual(res, ref)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 def test_basic(self):
     inp = 'Some string 1'
     res = ut.slugify(inp)
     ref = 'Some_string_1'
     self.assertEqual(res, ref)