Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 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)