def test_get_all_collections(self, get): get.return_value = self.LIST_RESPONSE # Assert that the mocked get function is called the way we expect keen.get_all_collections() # Check that the URL is generated correctly self.assertEqual("https://api.keen.io/3.0/projects/1k4jb23kjbkjkjsd/events", get.call_args[0][0]) # Check that the master_key in the Authorization header self.assertTrue(keen.master_key in get.call_args[1]["headers"]["Authorization"])