Best Python code snippet using localstack_python
test_ssm.py
Source:test_ssm.py
...15 Type='String',16 )17 self._assert('test_put', 'test_put')18 self._assert('/test_put', 'test_put')19 def test_hierarchical_parameter(self):20 ssm_client = aws_stack.connect_to_service('ssm')21 ssm_client.put_parameter(22 Name='/a/b/c',23 Value='123',24 Type='String',25 )26 self._assert('/a/b/c', '/a/b/c')27 self._assert('/a//b//c', '/a/b/c')28 self._assert('a/b//c', '/a/b/c')29 def test_get_secret_parameter(self):30 ssm_client = aws_stack.connect_to_service('ssm')31 sec_client = aws_stack.connect_to_service('secretsmanager')32 secret_name = 'test_secret'33 sec_client.create_secret(...
test_reporting_utilities.py
Source:test_reporting_utilities.py
...25 assert d[model.sub.sub2.linear] == 'Root/Sub1_0/Sub2_2/Linear_0'26 assert d[model.sub.sub2] == 'Root/Sub1_0/Sub2_2'27 assert d[model.sub] == 'Root/Sub1_0'28 assert d[model] == 'Root'29 def test_hierarchical_parameter(self):30 model = Root()31 d = trw.utils.collect_hierarchical_parameter_name('Root', model, with_grad_only=True)32 module_d = dict(model.sub.conv1.named_parameters(recurse=False))33 assert d[module_d['weight']] == 'Root/Sub1_0/Conv2d_0/weight'34 assert d[module_d['bias']] == 'Root/Sub1_0/Conv2d_0/bias'35 module_d = dict(model.sub.conv2.named_parameters(recurse=False))36 assert d[module_d['weight']] == 'Root/Sub1_0/Conv2d_1/weight'37 assert d[module_d['bias']] == 'Root/Sub1_0/Conv2d_1/bias'38 module_d = dict(model.sub.sub2.linear.named_parameters(recurse=False))39 assert d[module_d['weight']] == 'Root/Sub1_0/Sub2_2/Linear_0/weight'...
test_amps.py
Source:test_amps.py
...12 assert SAMPLED_SCENARIO["string_parameter"] == "string"13def test_list_parameter():14 assert NOMINAL_SCENARIO["list_parameter"] == ["item_1", "item_2", "item_3"]15 assert SAMPLED_SCENARIO["list_parameter"] == ["item_1", "item_2", "item_3"]16def test_hierarchical_parameter():17 assert NOMINAL_SCENARIO["hierarchical_parameter"]["one"]["A"] == 118 assert NOMINAL_SCENARIO["hierarchical_parameter"]["two"]["B"] == 419 assert SAMPLED_SCENARIO["hierarchical_parameter"]["one"]["A"] == 120 assert SAMPLED_SCENARIO["hierarchical_parameter"]["two"]["B"] == 421def test_relative_deterministic_parameter():22 assert NOMINAL_SCENARIO["relative_deterministic_parameter"] == 1623 assert SAMPLED_SCENARIO["relative_deterministic_parameter"] == 1624def test_relative_stochastic_parameter():25 assert NOMINAL_SCENARIO["relative_stochastic_parameter"] == 0.2526 assert SAMPLED_SCENARIO["relative_stochastic_parameter"] <= 0.527def test_log_scale():...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!