<gh_stars>0
#!/usr/bin/env python
from pathlib import Path
import subprocess
import sys
import pytest
import gitutils.find as pgf

R = Path(__file__).parent


def test_findfile():
    missdir = pgf.find_dir_missing_file("blahblah", "..")
    assert len(list(missdir)) > 0


def test_findfile_baddir(tmp_path):
    with pytest.raises(NotADirectoryError):
        next(pgf.find_dir_missing_file("blahblah", "asdfasfdfoo"))

    assert len(list(pgf.find_dir_missing_file("blahblah", tmp_path))) == 0

    assert len(list(pgf.find_dir_missing_file("test_find.py", R))) == 1


def test_findfile_script():
    subprocess.check_call([sys.executable, "find_missing_file.py", "blahblah", str(R.parent)], cwd=R.parent)


def test_actonchanged():
    subprocess.check_call([sys.executable, "ActOnChanged.py", str(R)], cwd=R.parent)


if __name__ == "__main__":
    pytest.main([__file__])

#!/usr/bin/env python
from pathlib import Path
import subprocess
import sys
import pytest
import gitutils.find as pgf

R = Path(__file__).parent


def test_findfile():
    missdir = pgf.find_dir_missing_file("blahblah", "..")
    assert len(list(missdir)) > 0


def test_findfile_baddir(tmp_path):
    with pytest.raises(NotADirectoryError):
        next(pgf.find_dir_missing_file("blahblah", "asdfasfdfoo"))

    assert len(list(pgf.find_dir_missing_file("blahblah", tmp_path))) == 0

    assert len(list(pgf.find_dir_missing_file("test_find.py", R))) == 1


def test_findfile_script():
    subprocess.check_call([sys.executable, "find_missing_file.py", "blahblah", str(R.parent)], cwd=R.parent)


def test_actonchanged():
    subprocess.check_call([sys.executable, "ActOnChanged.py", str(R)], cwd=R.parent)


if __name__ == "__main__":
    pytest.main([__file__])
#!/usr/bin/env python