How to use the placebo.Placebo.decorate function in placebo

To help you get started, we’ve selected a few placebo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huseyinyilmaz / placebo / tests / placebo_tests.py View on Github external
    @Placebo.decorate(url='http://www.example.com/api/item',
                      body=json.dumps({'name': 'Huseyin',
                                       'last_name': 'Yilmaz'}))
    def test_placebo_without_subclass(self):
        url = 'http://www.example.com/api/item'
        expected_response = {'name': 'Huseyin', 'last_name': 'Yilmaz'}

        response = requests.get(url)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.json(), expected_response)