def do_desired_state_test(path): fixture = fxt.get_anymarkup(path) with patch("reconcile.utils.gql.GqlApi.query") as m_gql: m_gql.return_value = fixture["gql_response"] desired_state = github_org.fetch_desired_state(infer_clusters=False).dump() expected_desired_state = fixture["state"] assert len(desired_state) == len(expected_desired_state) for group in desired_state: params = group["params"] items = sorted(group["items"]) assert items == get_items_by_params(expected_desired_state, params)
def do_desired_state_test(self, path): fixture = fxt.get_anymarkup(path) with patch('utils.gql.GqlApi.query') as m_gql: m_gql.return_value = fixture['gql_response'] desired_state = github_org.fetch_desired_state().dump() expected_desired_state = fixture['state'] assert len(desired_state) == len(expected_desired_state) for group in desired_state: params = group['params'] items = sorted(group['items']) assert items == get_items_by_params(expected_desired_state, params)