def test_add_admin_token_auth(mocker, items, expected_items): items = copy.deepcopy(items) mock_replace = mocker.patch("octane.util.keystone.replace_pipeline_items") mock_replace.return_value.__enter__.return_value = items keystone.add_admin_token_auth("fakefilename", "fakepipelines") assert items == expected_items mock_replace.assert_called_once_with("fakefilename", "fakepipelines")
def test_add_admin_token_auth_functional(mocker, parameters, writes): with verify_update_file(mocker, parameters, writes) as mock_update_file: keystone.add_admin_token_auth("fakefilename", [ "pipeline:public_api", "pipeline:admin_api", ]) mock_update_file.assert_called_once_with("fakefilename")