def test_add_space(self): step("Try to add new space using every client type.") errors = [] for client in self.user_clients: try: space_list = Space.api_get_list_in_org( org_guid=TestData.test_org.guid) if self.SPACE_PERMISSION[client]: new_space = Space.api_create( TestData.test_org, client=self.user_clients[client]) space_list = Space.api_get_list() assert new_space in space_list, "Space was not created." else: assert_raises_http_exception( HttpStatus.CODE_FORBIDDEN, HttpStatus.MSG_FORBIDDEN, Space.api_create, TestData.test_org, client=self.user_clients[client]) assert Space.api_get_list_in_org( org_guid=TestData.test_org.guid ) == space_list, "Space was created" except Exception as e: errors.append(e) assert_no_errors(errors)
def test_create_and_delete_space(core_org): """Create and Delete Space""" step("Create new space") test_space = Space.api_create(org=core_org) step("Check that the space was created") spaces = Space.api_get_list() assert test_space in spaces step("Delete the space") test_space.api_delete() step("Check that the space was deleted") assertions.assert_not_in_with_retry(test_space, Space.api_get_list)