def test_remove_attrib_then_braces(self): """Tests RHM._remove_braces() and RHM._remove_attr_names().""" res = rhm._remove_attr_names("{id:123}/user/{user_id:1234}") self.assertEqual("{123}/user/{1234}", res) res = rhm._remove_braces(res) self.assertEqual("123/user/1234", res)
def test_remove_braces_double_braces(self): """Tests RequestHelperMixin._remove_braces() with double braces.""" res = rhm._remove_braces("{{id:123}}") self.assertEqual("{id:123}", res)
def test_remove_braces_multi_vars(self): """Tests RequestHelperMixin._remove_braces() with multiple vars.""" res = rhm._remove_braces("{id:123}/user/{user_id:1234}") self.assertEqual("id:123/user/user_id:1234", res)
def test_remove_braces_named(self): """Tests RequestHelperMixin._remove_braces() with a named var.""" res = rhm._remove_braces("{id:123}") self.assertEqual("id:123", res)