Esempio n. 1
0
def test_is_python():
    tmp_dir = scratch_path / "is_python"
    tmp_dir.mkdir()
    f = (tmp_dir / "sample.txt").open("w")
    assert not util.is_python(f.name)
    f = (tmp_dir / "sample.py").open("w")
    assert util.is_python(f.name)
Esempio n. 2
0
def test_is_python():
    with TempDir() as d:
        f = open(os.path.join(d, "sample.txt"), "w")
        assert not util.is_python(f.name)
        f = open(os.path.join(d, "sample.py"), "w")
        assert util.is_python(f.name)
Esempio n. 3
0
def test_is_python():
    with TempDir() as d:
        f = open(os.path.join(d, 'sample.txt'), 'w')
        assert not util.is_python(f.name)
        f = open(os.path.join(d, 'sample.py'), 'w')
        assert util.is_python(f.name)