def testUndeleteHttpError(self):
   test_project = util.GetTestActiveProject()
   test_project_ref = command_lib_util.ParseProject(test_project.projectId)
   self.mock_client.projects.Undelete.Expect(
       self.messages.CloudresourcemanagerProjectsUndeleteRequest(
           projectId=test_project.projectId),
       exception=self.HttpError())
   with self.assertRaises(exceptions.HttpError):
     projects_api.Undelete(test_project_ref)
 def testUndelete(self):
   test_project = util.GetTestActiveProject()
   test_project_ref = command_lib_util.ParseProject(test_project.projectId)
   self.mock_client.projects.Undelete.Expect(
       self.messages.CloudresourcemanagerProjectsUndeleteRequest(
           projectId=test_project.projectId),
       self.messages.Empty())
   response = projects_api.Undelete(test_project_ref)
   self.assertEqual(response.projectId, test_project.projectId)
Exemplo n.º 3
0
 def Run(self, args):
     project_ref = command_lib_util.ParseProject(args.id)
     result = projects_api.Undelete(project_ref)
     log.RestoredResource(project_ref, kind='project')
     return result
Exemplo n.º 4
0
 def Run(self, args):
     project_ref = command_lib_util.ParseProject(args.id)
     result = projects_api.Undelete(project_ref)
     log.status.write('Undeleted [{r}].\n'.format(r=project_ref))
     return result