def test_as_request_get(self): action = SirenAction('action', 'http://blah.com', 'application/json') resp = action.as_request(x=1, y=2) self.assertIsInstance(resp, PreparedRequest) self.assertEqual(resp.method, 'GET') self.assertIn('y=2', resp.path_url) self.assertIn('x=1', resp.path_url)
def test_as_request_get(self): action = SirenAction('action', 'http://blah.com', 'application/json') resp = action.as_request(x=1, y=2) self.assertIsInstance(resp, PreparedRequest) self.assertEqual(resp.method, 'GET') self.assertIn('y=2', resp.path_url) self.assertIn('x=1', resp.path_url)
def test_as_request_delete(self): action = SirenAction('action', 'http://blah.com', 'application/json', method='DELETE') resp = action.as_request(x=1, y=2) self.assertIsInstance(resp, PreparedRequest) self.assertEqual(resp.method, 'DELETE') self.assertEqual('/', resp.path_url)
def test_as_request_delete(self): action = SirenAction('action', 'http://blah.com', 'application/json', method='DELETE') resp = action.as_request(x=1, y=2) self.assertIsInstance(resp, PreparedRequest) self.assertEqual(resp.method, 'DELETE') self.assertEqual('/', resp.path_url)