How to use get_available_stores method in tempest

Best Python code snippet using tempest_python

test_images_negative.py

Source:test_images_negative.py Github

copy

Full Screen

...149 'import-methods']['value']150 if not cls.available_import_methods:151 raise cls.skipException('Server does not support '152 'any import method')153 cls.available_stores = cls.get_available_stores()154 if not len(cls.available_stores) > 0:155 raise cls.skipException(156 'No stores configured %s' % cls.available_stores)157 @decorators.attr(type=['negative'])158 @decorators.idempotent_id('c52f6a77-f522-4411-8dbe-9d14f2b1ba6b')159 def test_image_web_download_import_with_bad_url(self):160 """Test 'web-download' import functionalities161 Make sure that web-download with invalid URL fails properly.162 """163 if 'web-download' not in self.available_import_methods:164 raise self.skipException('Server does not support '165 'web-download import method')166 image = self.client.create_image(name='test',167 container_format='bare',168 disk_format='raw')169 # Now try to get image details170 body = self.client.show_image(image['id'])171 self.assertEqual(image['id'], body['id'])172 self.assertEqual('queued', body['status'])173 stores = self.get_available_stores()174 # import image from web to backend175 image_uri = 'http://does-not.exist/no/possible/way'176 self.client.image_import(image['id'], method='web-download',177 import_params={'uri': image_uri},178 stores=[stores[0]['id']])179 start_time = int(time.time())180 while int(time.time()) - start_time < self.client.build_timeout:181 body = self.client.show_image(image['id'])182 if body.get('os_glance_failed_import'):183 # Store ended up in failed list, which is good184 return185 time.sleep(self.client.build_interval)...

Full Screen

Full Screen

test_images.py

Source:test_images.py Github

copy

Full Screen

...63 """Test 'copy-image' import functionalities64 Create image, import image with copy-image method and65 verify that import succeeded.66 """67 available_stores = self.get_available_stores()68 available_import_methods = self.client.info_import()[69 'import-methods']['value']70 # NOTE(gmann): Skip if copy-image import method and multistore71 # are not available.72 if ('copy-image' not in available_import_methods or73 not available_stores):74 raise self.skipException('Either copy-image import method or '75 'multistore is not available')76 uuid = data_utils.rand_uuid()77 image_name = data_utils.rand_name('copy-image')78 container_format = CONF.image.container_formats[0]79 disk_format = CONF.image.disk_formats[0]80 image = self.create_image(name=image_name,81 container_format=container_format,...

Full Screen

Full Screen

app.py

Source:app.py Github

copy

Full Screen

...25 else:26 return jsonify({'status': 'fail',27 'message': 'Invalid parameter inputs'}), 40028@app.route('/stores', methods=['GET'])29def get_available_stores():30 stores = Store.query.all()31 res = []32 for s in stores:33 if s.barcodes is not None:34 res.append({"id": s.id, "name": s.storeName})35 return jsonify(res)36@app.route('/stores/<int:store_id>', methods=['GET'])37def get_available_menus(store_id):38 storeid = store_id39 store = Store.query.filter(Store.id == storeid).first()40 if store is not None:41 menus = Barcode.query.filter(Barcode.storeName == store)42 res = []43 for m in menus:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful