@patch('requests.post')
    def test_not_implemented(self, r_post):
        # Verified response from the live API
        r_post.return_value = Mock(
            status_code=501,
            encoding='utf-8',
            text=mock_data.not_implemented_text
        )

        credentials = Mock(base_url="")
        xero = Xero(credentials)

        try:
            xero.organisations.save({})
            self.fail("Should raise a XeroNotImplemented.")

        except XeroNotImplemented as e:
            # Error messages have been extracted
            self.assertEqual(str(e), 'The Api Method called is not implemented')

            # The response has also been stored
            self.assertEqual(e.response.status_code, 501)
            self.assertTrue(e.response.text.startswith, '<ApiException')
        except Exception as e:
            self.fail("Should raise a XeroNotImplemented, not %s" % e)
Initialize a ChainMap by setting *maps* to the given mappings.
dataset/ETHPy150Open freakboy3742/pyxero/tests/exceptions.py/ExceptionsTest.test_not_implemented--crossover with--dataset/ETHPy150Open ionelmc/python-aspectlib/src/aspectlib/py2chainmap.py/ChainMap.__init__