def test_fetch_access_token_returns_the_access_token(self): self.stub_get_requests(response_body=self.valid_response_json) authenticator = Authenticator(client_id="foo", client_secret="bar") access_token = authenticator.fetch_access_token("my-code") self.assert_get_request( url="https://www.yammer.com/oauth2/access_token.json", headers={}, params={ "client_id": "foo", "client_secret": "bar", "code": "my-code", }, ) self.assertEqual("abc123", access_token)