@patch('requests.post')
    def test_bad_credentials(self, r_post):
        r_post.return_value = Mock(
            status_code=401,
            text='oauth_problem=consumer_key_unknown&oauth_problem_advice=Consumer%20key%20was%20not%20recognised'
        )

        with self.assertRaises(XeroUnauthorized):
            PublicCredentials(
                consumer_key='unknown',
                consumer_secret='unknown'
            )
Initial construction with bad credentials raises an exception
dataset/ETHPy150Open freakboy3742/pyxero/tests/auth.py/PublicCredentialsTest.test_bad_credentials