def test_get_project(self, mock_create_ks_admin_client): mock_client = mock.Mock( **{'projects.get.return_value.to_dict.return_value': mock.sentinel.project}) mock_create_ks_admin_client.return_value = mock_client project = auth_utils.get_project(mock.sentinel.pid) self.assertEqual(mock.sentinel.project, project) mock_client.projects.get.assert_called_once_with(mock.sentinel.pid) mock_client.projects.get.return_value.to_dict.assert_called_once_with()
def get_environment_owner(cls): fields = auth_utils.get_project( helpers.get_execution_session().environment_owner_project_id) return cls._to_object(fields)
def get_current(cls): fields = auth_utils.get_project( helpers.get_execution_session().project_id) return cls._to_object(fields)