Best Python code snippet using refurb_python
test_gen.py
Source:test_gen.py
1from pathlib import Path2from unittest.mock import patch3from refurb.gen import folders_needing_init_file4def test_folder_not_in_cwd_is_ignored():5 with patch("pathlib.Path.cwd", lambda: Path("/some/random/path")):6 assert folders_needing_init_file(Path("./some/path")) == []7def test_relative_path_works():8 assert folders_needing_init_file(Path("./a/b/c")) == [9 Path.cwd() / "a" / "b" / "c",10 Path.cwd() / "a" / "b",11 Path.cwd() / "a",12 ]13def test_absolute_path_works():14 assert folders_needing_init_file(Path.cwd() / "a" / "b" / "c" / "d") == [15 Path.cwd() / "a" / "b" / "c" / "d",16 Path.cwd() / "a" / "b" / "c",17 Path.cwd() / "a" / "b",18 Path.cwd() / "a",...
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!!