summaryrefslogtreecommitdiff
path: root/tests/test_main.py
blob: b3e50b542a7ea97ffa3ebe9d20a27cd5c8b890f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
from isort import main


def test_is_python_file(tmpdir):
    assert main.is_python_file("file.py")
    assert main.is_python_file("file.pyi")
    assert main.is_python_file("file.pyx")
    assert not main.is_python_file("file.pyc")
    assert not main.is_python_file("file.txt")

    fifo_file = os.path.join(tmpdir, "fifo_file")
    os.mkfifo(fifo_file)
    assert not main.is_python_file(fifo_file)