def test_authenticate_headers_appends_oauth(self): url = factory.make_name("url") consumer_key = factory.make_name("consumer_key") token_key = factory.make_name("token_key") token_secret = factory.make_name("token_secret") consumer_secret = factory.make_name("consumer_secret") creds = { "consumer_key": consumer_key, "token_key": token_key, "token_secret": token_secret, "consumer_secret": consumer_secret, } headers = {} maas_api_helper.authenticate_headers(url, headers, creds) self.assertIn("Authorization", headers)
def test_authenticate_headers_only_appends_with_consumer_key(self): headers = {} maas_api_helper.authenticate_headers(factory.make_name("url"), headers, {}) self.assertEqual({}, headers)