Best Python code snippet using localstack_python
test_text.py
Source:test_text.py
...75 [os.path.join(os.path.dirname(__file__), "text1.txt"), 9],76 [os.path.join(os.path.dirname(__file__), "text2.txt"), 15],77 ],78)79def test_non_ascii_chars(file_name, expected_result):80 assert text_counter.count_non_ascii_chars(file_name) == expected_result818283@pytest.mark.parametrize(84 "file_name, expected_result",85 [86 [os.path.join(os.path.dirname(__file__), "text1.txt"), "а"],87 [os.path.join(os.path.dirname(__file__), "text2.txt"), "п, а, м"],88 ],89)90def test_most_common_non_ascii_chars(file_name, expected_result):
...
test_json.py
Source:test_json.py
...28 session.add(document)29 session.commit()30 document = session.query(Document).first()31 assert document.json == {'something': 12}32 def test_non_ascii_chars(self, session, Document):33 document = Document(34 json={'something': u'äääööö'}35 )36 session.add(document)37 session.commit()38 document = session.query(Document).first()39 assert document.json == {'something': u'äääööö'}40@pytest.mark.skipif('json.json is None')41@pytest.mark.usefixtures('sqlite_memory_dsn')42class TestSqliteJSONType(JSONTestCase):43 pass44@pytest.mark.skipif('json.json is None')45@pytest.mark.usefixtures('postgresql_dsn')46class TestPostgresJSONType(JSONTestCase):...
test_compressed_string.py
Source:test_compressed_string.py
...22 def test_return_type(self):23 s = "123456789" * 1024 result = CompressedString(s).decompress()25 self.assertEqual(type(s), type(result))26 def test_non_ascii_chars(self):27 s = "12345äöüÃ6789" * 1028 result = CompressedString(s).decompress()29 self.assertEqual(s, result)30 self.assertEqual(type(s), type(result))31if __name__ == '__main__':...
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!!