Beispiel #1
0
    def test_post_returns_body_of_response_if_return_bool_False(
            self, mock_request):
        mock_request.return_value = {"success": True}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post(return_bool=False)

        self.assertEqual({"success": True}, response)
    def test_post_returns_body_of_response_if_return_bool_False(self, mock_request):
        mock_request.return_value = {"success": True}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post(return_bool=False)

        self.assertEqual({"success": True}, response)
    def test_post_returns_false_if_success_is_false(self, mock_request):
        mock_request.return_value = {"nope": False}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post()

        self.assertFalse(response)
    def test_post_returns_boolean_by_default(self, mock_request):
        mock_request.return_value = {"success": True}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post()

        self.assertTrue(response)
Beispiel #5
0
    def test_post_returns_false_if_success_is_false(self, mock_request):
        mock_request.return_value = {"nope": False}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post()

        self.assertFalse(response)
Beispiel #6
0
    def test_post_returns_boolean_by_default(self, mock_request):
        mock_request.return_value = {"success": True}
        base_resource = BaseResource(Mock(), "test/{id}", {"id": "fake_id"})
        response = base_resource.post()

        self.assertTrue(response)