def setUp(self): # Start the testing server self._server = TestServer() self._server.set_port(TESTING_PORT) self._server.set_max_request(1) self._server.start() _fill_provider_role('provider') WStoreSeleniumTestCase.setUp(self)
def tearDown(self): # Remove directories for path in self._dirs_to_remove: shutil.rmtree(path, ignore_errors=True) restore_indexes() restore_tags() WStoreSeleniumTestCase.tearDown(self)
def setUp(self): # Start the testing server self._server = TestServer() self._server.set_port(TESTING_PORT) self._server.set_max_request(2) self._server.start() _set_offering_organization('21000aba8e05ac2115f022ff', 'provider') WStoreSeleniumTestCase.setUp(self)
def tearDown(self): # Remove directories for path in self._dirs_to_remove: try: files = os.listdir(path) for f in files: file_path = os.path.join(path, f) os.remove(file_path) os.rmdir(path) except: pass restore_indexes() restore_tags() WStoreSeleniumTestCase.tearDown(self)
def tearDown(self): # If the server is still waiting for a call make a # fake call in order to terminate it if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass path = os.path.join(settings.BASEDIR, 'media/provider__test_offering__1.0') shutil.rmtree(path, ignore_errors=True) WStoreSeleniumTestCase.tearDown(self)
def setUp(self): # Start the testing server self._server = TestServer() self._server.set_port(TESTING_PORT) self._server.set_max_request(2) self._server.start() # Load USDL info offering1_info = { 'base_uri': 'http://localhost:8081', 'image_url': '/media/provider__test_offering1__1.0/image.png', 'name': 'test_offering1', 'description': 'test', 'pricing': { 'price_model': 'free' } } _fill_offering_description('21000aba8e05ac2115f022ff', offering1_info, 'provider') WStoreSeleniumTestCase.setUp(self)
def tearDown(self): if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass # Remove bills if needed for p in Purchase.objects.all(): for bill in p.bill: path = os.path.join(settings.BASEDIR, bill[1:]) try: os.remove(path) except: pass WStoreSeleniumTestCase.tearDown(self)
def setUp(self): # Fill offering info # Create test directories offering_path1 = os.path.join(settings.BASEDIR, 'media/provider__test_offering1__1.0') offering_path2 = os.path.join(settings.BASEDIR, 'media/provider__test_offering2__1.0') offering_path3 = os.path.join(settings.BASEDIR, 'media/provider__test_offering3__1.0') os.makedirs(offering_path1) os.makedirs(offering_path2) os.makedirs(offering_path3) self._dirs_to_remove.append(offering_path1) self._dirs_to_remove.append(offering_path2) self._dirs_to_remove.append(offering_path3) test_icon_path = os.path.join( settings.BASEDIR, 'wstore/defaulttheme/static/assets/img/noimage.png') shutil.copy2(test_icon_path, os.path.join(offering_path1, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path2, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path3, 'image.png')) _set_offering_organization('21000aba8e05ac2115f022ff', 'provider') _set_offering_organization('31000aba8e05ac2115f022f0', 'provider') _set_offering_organization('aaaaaaaaaaaaac2115f022f0', 'admin') _fill_purchase_org('61006aba8e05ac21bbbbbbbb', 'provider') _fill_provider_role('provider') # Create indexes save_indexes() _create_indexes() # Create tag indexes save_tags() _create_tags() WStoreSeleniumTestCase.setUp(self)
def tearDown(self): # If the server is still waiting for a call make a # fake call in order to terminate it if self._server.call_received() < self._server.max_request: from urllib2 import urlopen self._server.set_max_request(0) try: url = 'http://localhost:' + unicode(TESTING_PORT) urlopen(url) except: pass path = os.path.join(settings.BASEDIR, 'media/provider__test_offering__1.0') try: files = os.listdir(path) for f in files: file_path = os.path.join(path, f) os.remove(file_path) os.rmdir(path) except: pass WStoreSeleniumTestCase.tearDown(self)
def setUp(self): # Fill offering info # Create test directories offering_path1 = os.path.join(settings.BASEDIR, 'media/provider__test_offering1__1.0') offering_path2 = os.path.join(settings.BASEDIR, 'media/provider__test_offering2__1.0') offering_path3 = os.path.join(settings.BASEDIR, 'media/provider__test_offering3__1.0') os.makedirs(offering_path1) os.makedirs(offering_path2) os.makedirs(offering_path3) self._dirs_to_remove.append(offering_path1) self._dirs_to_remove.append(offering_path2) self._dirs_to_remove.append(offering_path3) test_icon_path = os.path.join(settings.BASEDIR, 'wstore/defaulttheme/static/assets/img/noimage.png') shutil.copy2(test_icon_path, os.path.join(offering_path1, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path2, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path3, 'image.png')) _set_offering_organization('21000aba8e05ac2115f022ff', 'provider') _set_offering_organization('31000aba8e05ac2115f022f0', 'provider') _set_offering_organization('aaaaaaaaaaaaac2115f022f0', 'admin') _fill_purchase_org('61006aba8e05ac21bbbbbbbb', 'provider') _fill_provider_role('provider') # Create indexes save_indexes() _create_indexes() # Create tag indexes save_tags() _create_tags() WStoreSeleniumTestCase.setUp(self)
def __init__(self, methodName='runTest'): WStoreSeleniumTestCase.__init__(self, methodName=methodName) self.fixtures.extend(['repositories.json'])
def __init__(self, methodName='runTest'): self.fixtures.extend(['resources.json']) WStoreSeleniumTestCase.__init__(self, methodName=methodName)
def __init__(self, methodName='runTest'): WStoreSeleniumTestCase.__init__(self, methodName=methodName) self.fixtures.extend(['basic_offerings.json', 'oauth_info.json'])
def setUp(self): # Fill offering info # Create test directories offering_path1 = os.path.join(settings.BASEDIR, 'media/provider__test_offering1__1.0') offering_path2 = os.path.join(settings.BASEDIR, 'media/provider__test_offering2__1.0') offering_path3 = os.path.join(settings.BASEDIR, 'media/provider__test_offering3__1.0') os.makedirs(offering_path1) os.makedirs(offering_path2) os.makedirs(offering_path3) self._dirs_to_remove.append(offering_path1) self._dirs_to_remove.append(offering_path2) self._dirs_to_remove.append(offering_path3) test_icon_path = os.path.join(settings.BASEDIR, 'wstore/defaulttheme/static/assets/img/noimage.png') shutil.copy2(test_icon_path, os.path.join(offering_path1, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path2, 'image.png')) shutil.copy2(test_icon_path, os.path.join(offering_path3, 'image.png')) # Load USDL info offering1_info = { 'base_uri': 'http://localhost:8081', 'image_url': '/media/provider__test_offering1__1.0/image.png', 'name': 'test_offering1', 'description': 'test', 'pricing': { 'price_model': 'free' } } _fill_offering_description('21000aba8e05ac2115f022ff', offering1_info, 'provider') offering2_info = { 'base_uri': 'http://localhost:8081', 'image_url': '/media/provider__test_offering2__1.0/image.png', 'name': 'test_offering2', 'description': 'example', 'pricing': { 'price_model': 'free' } } _fill_offering_description('31000aba8e05ac2115f022f0', offering2_info, 'provider') offering3_info = { 'base_uri': 'http://localhost:8081', 'image_url': '/media/provider__test_offering3__1.0/image.png', 'name': 'test_offering3', 'description': 'example offering 3', 'pricing': { 'price_model': 'free' } } _fill_offering_description('aaaaaaaaaaaaac2115f022f0', offering3_info, 'admin') _fill_purchase_org('61006aba8e05ac21bbbbbbbb', 'provider') _fill_provider_role('provider') # Create indexes save_indexes() _create_indexes() # Create tag indexes save_tags() _create_tags() WStoreSeleniumTestCase.setUp(self)