Best Python code snippet using avocado_python
test_utility_calls.py
Source:test_utility_calls.py
2import spynnaker.pyNN.utilities.utility_calls as utility_calls3import os, time4import shutil5class TestUtilityCalls(unittest.TestCase):6 def test_check_directory_exists(self):7 utility_calls.check_directory_exists_and_create_if_not(os.path.dirname(8 os.path.realpath(__file__)))9 self.assertTrue(os.path.exists(os.path.dirname(10 os.path.realpath(__file__))))11 def test_check_directory_not_exists(self):12 test_dir = os.path.join(os.path.dirname(__file__),13 "test_utility_call")14 test_file = os.path.join(test_dir, "test")15 if os.path.exists(test_dir):16 shutil.rmtree(test_dir)17 print "Directory existed. Deleting..."18 utility_calls.check_directory_exists_and_create_if_not(test_file)19 if os.path.exists(test_dir):20 os.rmdir(test_dir)...
test_fileio.py
Source:test_fileio.py
...9 print(f"removing {d}")10 if Path(d).exists():11 Path(d).rmdir()12class TestFileIO(object):13 def test_check_directory_exists(self, directory):14 p = check_directory_exists(directory)15 assert p == directory16 def test_read_yaml(self):17 test_yml = """18 projects:19 project-1:20 connection: project-1-snowflake21 schema:22 database_1:23 - schema_124 - schema_225 """26 yml_expected = yaml.load(test_yml)27 yml = read_yaml("test/unit/test.yml")...
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!!