# vim: set fileencoding=utf8 # encoding:utf8 # # Author: Matthias Schmitz import os import unittest import oca from oca.exceptions import OpenNebulaException @unittest.skipUnless(os.environ.get('OCA_INT_TESTS', False), "Skipping integration tests") class IntTestTemplate(unittest.TestCase): def setUp(self): try: del os.environ["ONE_AUTH"] except KeyError: pass self.c = oca.Client(os.environ['OCA_INT_TESTS_ONE_AUTH'], os.environ['OCA_INT_TESTS_ONE_XMLRPC']) def tearDown(self): print("teardown") vmp = oca.VirtualMachinePool(self.c) vmp.info() for vm in vmp: if vm.name.startswith('inttest_vm_'): vm.delete() def test_allocate(self): templ = oca.VmTemplate.allocate(self.c, 'inttest01