Exemplo n.º 1
0
 def test_get_bound_href(self):
     action = SirenAction('action', 'blah', 'application/json')
     bound_href, request_fields = action._get_bound_href(TemplatedString,
                                                         x=1,
                                                         y=2)
     self.assertEqual(bound_href, 'blah')
     self.assertDictEqual(request_fields, dict(x=1, y=2))
Exemplo n.º 2
0
 def test_get_bound_href_with_template(self):
     action = SirenAction('action', 'http://host.com/{id}/{id}',
                          'application/json')
     bound_href, request_fields = action._get_bound_href(TemplatedString,
                                                         x=1,
                                                         y=2,
                                                         id=3)
     self.assertEqual(bound_href, 'http://host.com/3/3')
     self.assertDictEqual(dict(x=1, y=2), request_fields)
Exemplo n.º 3
0
 def test_get_bound_href_with_template(self):
     action = SirenAction('action', 'http://host.com/{id}/{id}', 'application/json')
     bound_href, request_fields = action._get_bound_href(TemplatedString, x=1, y=2, id=3)
     self.assertEqual(bound_href, 'http://host.com/3/3')
     self.assertDictEqual(dict(x=1, y=2), request_fields)
Exemplo n.º 4
0
 def test_get_bound_href(self):
     action = SirenAction('action', 'blah', 'application/json')
     bound_href, request_fields = action._get_bound_href(TemplatedString, x=1, y=2)
     self.assertEqual(bound_href, 'blah')
     self.assertDictEqual(request_fields, dict(x=1, y=2))