Best Python code snippet using localstack_python
test_common.py
Source:test_common.py
...241 def test_parse_json_or_yaml_with_invalid_syntax_returns_content(self):242 markup = "<a href='foobar'>baz</a>"243 doc = common.parse_json_or_yaml(markup)244 self.assertEqual(markup, doc) # FIXME: not sure if this is good behavior245 def test_parse_json_or_yaml_with_empty_string_returns_none(self):246 doc = common.parse_json_or_yaml("")247 self.assertIsNone(doc)248 def test_format_bytes(self):249 fn = common.format_bytes250 self.assertEqual("1B", fn(1))251 self.assertEqual("100B", fn(100))252 self.assertEqual("999B", fn(999))253 self.assertEqual("1KB", fn(1e3))254 self.assertEqual("1MB", fn(1e6))255 self.assertEqual("10MB", fn(1e7))256 self.assertEqual("100MB", fn(1e8))257 self.assertEqual("1GB", fn(1e9))258 self.assertEqual("1TB", fn(1e12))259 # comma values...
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!!