def test_new_reqs_file_added(temp_dir): with temp_dir.as_cwd(): # Should fail since 'requirements-dev.txt' is added to git f = "requirements-dev.txt" temp_dir.join(f).write("a" * 1000) cmd_output("git", "add", f) assert main(argv=[f, "--requirements", f]) == 1
def test_adding_requirements(temp_dir): with temp_dir.as_cwd(): # Should not fail with default f = "requirements.txt" temp_dir.join(f).write("a" * 1000) cmd_output("git", "add", f) assert main(argv=[f]) == 1
def temp_git_dir(tmpdir): git_dir = tmpdir.join("gits") cmd_output("git", "init", "--", str(git_dir)) yield git_dir
def test_adding_pyproject(temp_dir): with temp_dir.as_cwd(): # Should not fail with default cmd_output("git", "add", "pyproject.toml") assert main(argv=["pyproject.toml"]) == 1
def test_adding_nothing(temp_dir): with temp_dir.as_cwd(): # Should not fail with default temp_dir.join("f.py").write("a" * 10000) cmd_output("git", "add", "f.py") assert main(argv=["f.py"]) == 0
def test_adding_lock(temp_dir): with temp_dir.as_cwd(): # Should not fail with default f = "poetry.lock" cmd_output("git", "add", f) assert main(argv=[f]) == 1