How to use show_extension method in tempest

Best Python code snippet using tempest_python

test_extension_commands.py

Source:test_extension_commands.py Github

copy

Full Screen

...54 def test_add_list_show_remove_extension(self):55 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)56 actual = list_extensions()57 self.assertEqual(len(actual), 1)58 ext = show_extension(MY_EXT_NAME)59 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)60 remove_extension(MY_EXT_NAME)61 num_exts = len(list_extensions())62 self.assertEqual(num_exts, 0)63 def test_add_list_show_remove_system_extension(self):64 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE, system=True)65 actual = list_extensions()66 self.assertEqual(len(actual), 1)67 ext = show_extension(MY_EXT_NAME)68 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)69 remove_extension(MY_EXT_NAME)70 num_exts = len(list_extensions())71 self.assertEqual(num_exts, 0)72 def test_add_list_show_remove_user_system_extensions(self):73 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)74 add_extension(cmd=self.cmd, source=MY_SECOND_EXT_SOURCE_DASHES, system=True)75 actual = list_extensions()76 self.assertEqual(len(actual), 2)77 ext = show_extension(MY_EXT_NAME)78 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)79 self.assertEqual(ext[OUT_KEY_PATH], build_extension_path(MY_EXT_NAME))80 second_ext = show_extension(MY_SECOND_EXT_NAME_DASHES)81 self.assertEqual(second_ext[OUT_KEY_NAME], MY_SECOND_EXT_NAME_DASHES)82 self.assertEqual(second_ext[OUT_KEY_PATH], build_extension_path(MY_SECOND_EXT_NAME_DASHES, system=True))83 remove_extension(MY_EXT_NAME)84 num_exts = len(list_extensions())85 self.assertEqual(num_exts, 1)86 remove_extension(MY_SECOND_EXT_NAME_DASHES)87 num_exts = len(list_extensions())88 self.assertEqual(num_exts, 0)89 def test_add_list_show_remove_extension_with_dashes(self):90 add_extension(cmd=self.cmd, source=MY_SECOND_EXT_SOURCE_DASHES)91 actual = list_extensions()92 self.assertEqual(len(actual), 1)93 ext = show_extension(MY_SECOND_EXT_NAME_DASHES)94 self.assertEqual(ext[OUT_KEY_NAME], MY_SECOND_EXT_NAME_DASHES)95 self.assertIn(OUT_KEY_NAME, ext[OUT_KEY_METADATA], "Unable to get full metadata")96 self.assertEqual(ext[OUT_KEY_METADATA][OUT_KEY_NAME], MY_SECOND_EXT_NAME_DASHES)97 remove_extension(MY_SECOND_EXT_NAME_DASHES)98 num_exts = len(list_extensions())99 self.assertEqual(num_exts, 0)100 def test_add_extension_twice(self):101 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)102 num_exts = len(list_extensions())103 self.assertEqual(num_exts, 1)104 with self.assertRaises(CLIError):105 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)106 def test_add_same_extension_user_system(self):107 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)108 num_exts = len(list_extensions())109 self.assertEqual(num_exts, 1)110 with self.assertRaises(CLIError):111 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE, system=True)112 def test_add_extension_invalid(self):113 with self.assertRaises(ValueError):114 add_extension(cmd=self.cmd, source=MY_BAD_EXT_SOURCE)115 actual = list_extensions()116 self.assertEqual(len(actual), 0)117 def test_add_extension_invalid_whl_name(self):118 with self.assertRaises(CLIError):119 add_extension(cmd=self.cmd, source=os.path.join('invalid', 'ext', 'path', 'file.whl'))120 actual = list_extensions()121 self.assertEqual(len(actual), 0)122 def test_add_extension_valid_whl_name_filenotfound(self):123 with self.assertRaises(CLIError):124 add_extension(cmd=self.cmd, source=_get_test_data_file('mywheel-0.0.3+dev-py2.py3-none-any.whl'))125 actual = list_extensions()126 self.assertEqual(len(actual), 0)127 def test_add_extension_with_pip_proxy(self):128 extension_name = MY_EXT_NAME129 proxy_param = '--proxy'130 proxy_endpoint = "https://user:pass@proxy.microsoft.com"131 computed_extension_sha256 = _compute_file_hash(MY_EXT_SOURCE)132 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)), \133 mock.patch('azure.cli.core.extension.operations.shutil'), \134 mock.patch('azure.cli.core.extension.operations.check_output') as check_output:135 add_extension(cmd=self.cmd, extension_name=extension_name, pip_proxy=proxy_endpoint)136 args = check_output.call_args137 pip_cmd = args[0][0]138 proxy_index = pip_cmd.index(proxy_param)139 assert pip_cmd[proxy_index + 1] == proxy_endpoint140 def test_add_extension_verify_no_pip_proxy(self):141 extension_name = MY_EXT_NAME142 computed_extension_sha256 = _compute_file_hash(MY_EXT_SOURCE)143 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)), \144 mock.patch('azure.cli.core.extension.operations.shutil'), \145 mock.patch('azure.cli.core.extension.operations.check_output') as check_output:146 add_extension(cmd=self.cmd, extension_name=extension_name)147 args = check_output.call_args148 pip_cmd = args[0][0]149 if '--proxy' in pip_cmd:150 raise AssertionError("proxy parameter in check_output args although no proxy specified")151 def test_add_extension_with_specific_version(self):152 extension_name = MY_EXT_NAME153 extension1 = 'myfirstcliextension-0.0.3+dev-py2.py3-none-any.whl'154 extension2 = 'myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl'155 mocked_index_data = {156 extension_name: [157 mock_ext(extension1, version='0.0.3+dev', download_url=_get_test_data_file(extension1)),158 mock_ext(extension2, version='0.0.4+dev', download_url=_get_test_data_file(extension2))159 ]160 }161 with IndexPatch(mocked_index_data):162 add_extension(self.cmd, extension_name=extension_name, version='0.0.3+dev')163 ext = show_extension(extension_name)164 self.assertEqual(ext['name'], extension_name)165 self.assertEqual(ext['version'], '0.0.3+dev')166 def test_add_extension_with_non_existing_version(self):167 extension_name = MY_EXT_NAME168 extension1 = 'myfirstcliextension-0.0.3+dev-py2.py3-none-any.whl'169 extension2 = 'myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl'170 mocked_index_data = {171 extension_name: [172 mock_ext(extension1, version='0.0.3+dev', download_url=_get_test_data_file(extension1)),173 mock_ext(extension2, version='0.0.4+dev', download_url=_get_test_data_file(extension2))174 ]175 }176 non_existing_version = '0.0.5'177 with IndexPatch(mocked_index_data):178 with self.assertRaisesRegex(CLIError, non_existing_version):179 add_extension(self.cmd, extension_name=extension_name, version=non_existing_version)180 def test_add_extension_with_name_valid_checksum(self):181 extension_name = MY_EXT_NAME182 computed_extension_sha256 = _compute_file_hash(MY_EXT_SOURCE)183 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)):184 add_extension(cmd=self.cmd, extension_name=extension_name)185 ext = show_extension(MY_EXT_NAME)186 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)187 def test_add_extension_with_name_invalid_checksum(self):188 extension_name = MY_EXT_NAME189 bad_sha256 = 'thishashisclearlywrong'190 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, bad_sha256)):191 with self.assertRaises(CLIError) as err:192 add_extension(cmd=self.cmd, extension_name=extension_name)193 self.assertTrue('The checksum of the extension does not match the expected value.' in str(err.exception))194 def test_add_extension_with_name_source_not_whl(self):195 extension_name = 'myextension'196 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=('{}.notwhl'.format(extension_name), None)):197 with self.assertRaises(ValueError) as err:198 add_extension(cmd=self.cmd, extension_name=extension_name)199 self.assertTrue('Unknown extension type. Only Python wheels are supported.' in str(err.exception))200 def test_add_extension_with_name_but_it_already_exists(self):201 # Add extension without name first202 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)203 ext = show_extension(MY_EXT_NAME)204 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)205 # Now add using name206 computed_extension_sha256 = _compute_file_hash(MY_EXT_SOURCE)207 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)):208 with mock.patch('azure.cli.core.extension.operations.logger') as mock_logger:209 add_extension(cmd=self.cmd, extension_name=MY_EXT_NAME)210 call_args = mock_logger.warning.call_args211 self.assertEqual("Extension '%s' is already installed.", call_args[0][0])212 self.assertEqual(MY_EXT_NAME, call_args[0][1])213 self.assertEqual(mock_logger.warning.call_count, 1)214 def test_update_extension(self):215 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)216 ext = show_extension(MY_EXT_NAME)217 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')218 newer_extension = _get_test_data_file('myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl')219 computed_extension_sha256 = _compute_file_hash(newer_extension)220 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(newer_extension, computed_extension_sha256)):221 update_extension(self.cmd, MY_EXT_NAME)222 ext = show_extension(MY_EXT_NAME)223 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.4+dev')224 def test_update_extension_with_pip_proxy(self):225 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)226 ext = show_extension(MY_EXT_NAME)227 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')228 newer_extension = _get_test_data_file('myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl')229 computed_extension_sha256 = _compute_file_hash(newer_extension)230 proxy_param = '--proxy'231 proxy_endpoint = "https://user:pass@proxy.microsoft.com"232 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)), \233 mock.patch('azure.cli.core.extension.operations.shutil'), \234 mock.patch('azure.cli.core.extension.operations.is_valid_sha256sum', return_value=(True, computed_extension_sha256)), \235 mock.patch('azure.cli.core.extension.operations.extension_exists', return_value=None), \236 mock.patch('azure.cli.core.extension.operations.check_output') as check_output:237 update_extension(self.cmd, MY_EXT_NAME, pip_proxy=proxy_endpoint)238 args = check_output.call_args239 pip_cmd = args[0][0]240 proxy_index = pip_cmd.index(proxy_param)241 assert pip_cmd[proxy_index + 1] == proxy_endpoint242 def test_update_extension_verify_no_pip_proxy(self):243 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)244 ext = show_extension(MY_EXT_NAME)245 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')246 newer_extension = _get_test_data_file('myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl')247 computed_extension_sha256 = _compute_file_hash(newer_extension)248 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(MY_EXT_SOURCE, computed_extension_sha256)), \249 mock.patch('azure.cli.core.extension.operations.shutil'), \250 mock.patch('azure.cli.core.extension.operations.is_valid_sha256sum', return_value=(True, computed_extension_sha256)), \251 mock.patch('azure.cli.core.extension.operations.extension_exists', return_value=None), \252 mock.patch('azure.cli.core.extension.operations.check_output') as check_output:253 update_extension(self.cmd, MY_EXT_NAME)254 args = check_output.call_args255 pip_cmd = args[0][0]256 if '--proxy' in pip_cmd:257 raise AssertionError("proxy parameter in check_output args although no proxy specified")258 def test_update_extension_not_found(self):259 with self.assertRaises(CLIError) as err:260 update_extension(self.cmd, MY_EXT_NAME)261 self.assertEqual(str(err.exception), 'The extension {} is not installed.'.format(MY_EXT_NAME))262 def test_update_extension_no_updates(self):263 logger_msgs = []264 def mock_log_warning(_, msg):265 logger_msgs.append(msg)266 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)267 ext = show_extension(MY_EXT_NAME)268 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')269 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', side_effect=NoExtensionCandidatesError()), \270 mock.patch('logging.Logger.warning', mock_log_warning):271 update_extension(self.cmd, MY_EXT_NAME)272 self.assertTrue("No updates available for '{}'.".format(MY_EXT_NAME) in logger_msgs[0])273 def test_update_extension_exception_in_update_and_rolled_back(self):274 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)275 ext = show_extension(MY_EXT_NAME)276 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')277 newer_extension = _get_test_data_file('myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl')278 bad_sha256 = 'thishashisclearlywrong'279 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(newer_extension, bad_sha256)):280 with self.assertRaises(CLIError) as err:281 update_extension(self.cmd, MY_EXT_NAME)282 self.assertTrue('Failed to update. Rolled {} back to {}.'.format(ext['name'], ext[OUT_KEY_VERSION]) in str(err.exception))283 ext = show_extension(MY_EXT_NAME)284 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')285 def test_list_available_extensions_default(self):286 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', autospec=True) as c:287 list_available_extensions()288 c.assert_called_once_with(None)289 def test_list_available_extensions_operations_index_url(self):290 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', autospec=True) as c:291 index_url = 'http://contoso.com'292 list_available_extensions(index_url=index_url)293 c.assert_called_once_with(index_url)294 def test_list_available_extensions_show_details(self):295 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', autospec=True) as c:296 list_available_extensions(show_details=True)297 c.assert_called_once_with(None)298 def test_list_available_extensions_no_show_details(self):299 sample_index_extensions = {300 'test_sample_extension1': [{301 'metadata': {302 'name': 'test_sample_extension1',303 'summary': 'my summary',304 'version': '0.1.0'305 }}],306 'test_sample_extension2': [{307 'metadata': {308 'name': 'test_sample_extension2',309 'summary': 'my summary',310 'version': '0.1.0',311 'azext.isPreview': True,312 'azext.isExperimental': True313 }}]314 }315 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', return_value=sample_index_extensions):316 res = list_available_extensions()317 self.assertIsInstance(res, list)318 self.assertEqual(len(res), len(sample_index_extensions))319 self.assertEqual(res[0]['name'], 'test_sample_extension1')320 self.assertEqual(res[0]['summary'], 'my summary')321 self.assertEqual(res[0]['version'], '0.1.0')322 self.assertEqual(res[0]['preview'], False)323 self.assertEqual(res[0]['experimental'], False)324 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', return_value=sample_index_extensions):325 res = list_available_extensions()326 self.assertIsInstance(res, list)327 self.assertEqual(len(res), len(sample_index_extensions))328 self.assertEqual(res[1]['name'], 'test_sample_extension2')329 self.assertEqual(res[1]['summary'], 'my summary')330 self.assertEqual(res[1]['version'], '0.1.0')331 self.assertEqual(res[1]['preview'], True)332 self.assertEqual(res[1]['experimental'], True)333 def test_list_available_extensions_incompatible_cli_version(self):334 sample_index_extensions = {335 'test_sample_extension1': [{336 'metadata': {337 "azext.maxCliCoreVersion": "0.0.0",338 'name': 'test_sample_extension1',339 'summary': 'my summary',340 'version': '0.1.0'341 }}]342 }343 with mock.patch('azure.cli.core.extension.operations.get_index_extensions', return_value=sample_index_extensions):344 res = list_available_extensions()345 self.assertIsInstance(res, list)346 self.assertEqual(len(res), 0)347 def test_add_list_show_remove_extension_extra_index_url(self):348 """349 Tests extension addition while specifying --extra-index-url parameter.350 :return:351 """352 extra_index_urls = ['https://testpypi.python.org/simple', 'https://pypi.python.org/simple']353 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE, pip_extra_index_urls=extra_index_urls)354 actual = list_extensions()355 self.assertEqual(len(actual), 1)356 ext = show_extension(MY_EXT_NAME)357 self.assertEqual(ext[OUT_KEY_NAME], MY_EXT_NAME)358 remove_extension(MY_EXT_NAME)359 num_exts = len(list_extensions())360 self.assertEqual(num_exts, 0)361 def test_update_extension_extra_index_url(self):362 """363 Tests extension update while specifying --extra-index-url parameter.364 :return:365 """366 extra_index_urls = ['https://testpypi.python.org/simple', 'https://pypi.python.org/simple']367 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE, pip_extra_index_urls=extra_index_urls)368 ext = show_extension(MY_EXT_NAME)369 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.3+dev')370 newer_extension = _get_test_data_file('myfirstcliextension-0.0.4+dev-py2.py3-none-any.whl')371 computed_extension_sha256 = _compute_file_hash(newer_extension)372 with mock.patch('azure.cli.core.extension.operations.resolve_from_index', return_value=(newer_extension, computed_extension_sha256)):373 update_extension(self.cmd, MY_EXT_NAME, pip_extra_index_urls=extra_index_urls)374 ext = show_extension(MY_EXT_NAME)375 self.assertEqual(ext[OUT_KEY_VERSION], '0.0.4+dev')376 def test_add_extension_to_path(self):377 add_extension(cmd=self.cmd, source=MY_EXT_SOURCE)378 num_exts = len(list_extensions())379 self.assertEqual(num_exts, 1)380 ext = get_extension('myfirstcliextension')381 old_path = sys.path[:]382 try:383 add_extension_to_path(ext.name)384 self.assertSequenceEqual(old_path, sys.path[:-1])385 self.assertEqual(ext.path, sys.path[-1])386 finally:387 sys.path[:] = old_path388 def test_add_extension_azure_to_path(self):...

Full Screen

Full Screen

region_writer.py

Source:region_writer.py Github

copy

Full Screen

1""" Class to write out region files compatable with ds9. 2$Header$3author: Joshua Lande4"""5from uw.like.roi_extended import ExtendedSource6from uw.like.SpatialModels import *7from math import degrees8def unparse_point(ps,label_sources):9 string="fk5; point(%.4f, %.4f) # point=cross" % \10 (ps.skydir.ra(),ps.skydir.dec())11 if label_sources: string += " text={%s}" % ps.name12 return string13def unparse_point_sources(point_sources,show_sources,label_sources):14 return [unparse_point(ps,label_sources) for ps in point_sources] if show_sources else []15def unparse_extension(spatial_model,extension_color=None,r68=False):16 """ By default, return edge for disk source,17 inner and outer edge for ring sources,18 and otherwise the 68% edge.19 20 If r68 flag is true, always return 68% edge21 of extended source. """22 sm = spatial_model23 extra = 'color=%s' % extension_color if extension_color is not None else '' 24 if isinstance(sm,PseudoSpatialModel) or type(sm) == SpatialMap:25 return []26 ra,dec=sm.center.ra(),sm.center.dec()27 if isinstance(sm,RadiallySymmetricModel):28 sigma=sm.sigma29 if isinstance(sm,Disk) and r68 is False:30 return ["fk5; circle(%.4f, %.4f, %.4f) # %s Circle encloses all of the disk." % \31 (ra,dec,sigma,extra)]32 elif isinstance(sm,Ring) and r68 is False:33 frac=sm.frac34 return ["fk5; circle(%.4f, %.4f, %.4f) # %s" % \35 (ra,dec,_,extra) for _ in [frac*sigma,sigma]]36 else: 37 return ["fk5; circle(%.4f, %.4f, %.4f) # %s Circle containing 68 percent of the source." % \38 (ra,dec,sm.r68(),extra)]39 elif isinstance(sm,EllipticalSpatialModel):40 sigma_x, sigma_y, theta = sm.sigma_x, sm.sigma_y, sm.theta41 if isinstance(sm,EllipticalDisk) and r68 is False:42 return ["fk5; ellipse(%.4f, %.4f, %.4f, %.4f, %.4f) # %s" % \43 (ra,dec,sigma_y,sigma_x,sm.theta,extra)]44 elif isinstance(sm,EllipticalRing) and r68 is False:45 frac = sm.frac46 return ["fk5; ellipse(%.4f, %.4f, %.4f, %.4f, %.4f) # %s" % \47 (ra,dec,_*sigma_y,_*sigma_x,sm.theta,extra) \48 for _ in [frac,1]]49 else:50 a,b,c=sm.ellipse_68()51 return ["fk5; ellipse(%.4f, %.4f, %.4f, %.4f, %.4f) # %s" % \52 (ra,dec,b,a,c,extra)]53 else:54 raise Exception("Unable to Parse Spatial Model %s" % type(sm))55def unparse_diffuse_sources(diffuse_sources,show_sources,label_sources,show_extension,extension_color):56 """ There is the same inconsistency in ellipse definition 57 between extended sources ellipses and ds9 ellipses as58 is discussed in the docstring for unparse_localization,59 resulting in the same switch from maj,min <-> min,maj. """60 lines = []61 for ds in diffuse_sources:62 if isinstance(ds,ExtendedSource):63 sm = ds.spatial_model64 if show_sources: 65 lines.append(unparse_point(ds,label_sources))66 if show_extension:67 lines += unparse_extension(sm,extension_color)68 return lines69def unparse_localization(roi):70 """ Note that maj and min are switched. This is caused by a discrepancy between71 pointlike's localization code and ds9's ellipse definition. It was 72 discussed in http://confluence.slac.stanford.edu/x/JSCJBQ73 The same link is: https://confluence.slac.stanford.edu/display/SCIGRPS/LAT+Catalog+ds9+regions74 """75 if roi.__dict__.has_key('qform'):76 ra,dec=roi.qform.par[0:2]77 a,b,ang=roi.qform.par[3:6]78 return ["# The next line is the localization error",79 "fk5; ellipse(%.4f, %.4f, %.4f, %.4f, %.4f)" % \80 (ra,dec,b,a,ang)]81 else:82 return []83def get_region(roi,color,show_sources=True, label_sources=True,show_localization=True,show_extension=True,extension_color=None):84 lines = [85 "# Region file format: DS9 version 4.0",86 "global color=%s" % color,87 ]88 lines += unparse_diffuse_sources(roi.dsm.diffuse_sources,show_sources,label_sources,show_extension,extension_color)89 lines += unparse_point_sources(roi.psm.point_sources,show_sources,label_sources)90 if show_localization:91 lines += unparse_localization(roi)92 if len(lines)==2: return None93 return '\n'.join(lines)94def writeRegion(roi,filename,color='green',show_sources=True, label_sources=True,show_localization=True, show_extension=True):95 """ Saves out an ROI to a ds9 style region file.96 97 The size of simple exended sources is saved to the region file98 as are elliptical localization errors if they exist. """99 file=open(filename,'w')100 file.write(get_region(roi,color,show_sources,label_sources,show_localization,show_extension))...

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