def test_ensure_trailing_slash_string_type(self): # Given a unicode string, ensure_trailing_slash will always return a # unicode string, and given a byte string it will always return a byte # string. self.assertIsInstance(utils.ensure_trailing_slash("fred"), str) self.assertIsInstance(utils.ensure_trailing_slash(b"fred"), bytes)
def test_ensure_trailing_slash_string_type(self): # Given a unicode string, ensure_trailing_slash will always return a # unicode string, and given a byte string it will always return a byte # string. self.assertIsInstance(utils.ensure_trailing_slash(u"fred"), unicode) self.assertIsInstance(utils.ensure_trailing_slash(b"fred"), bytes)
def test_ensure_trailing_slash(self): # ensure_trailing_slash ensures that the given string - typically a # URL or path - has a trailing forward slash. self.assertEqual("fred/", utils.ensure_trailing_slash("fred")) self.assertEqual("fred/", utils.ensure_trailing_slash("fred/"))