summaryrefslogtreecommitdiff
path: root/tests/test_main.py
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2020-01-07 10:28:59 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2020-01-07 10:28:59 -0800
commit4384bc058968a83e095ae0ce14fafbff90fa4c1a (patch)
tree8adf4ebcfcc575389afd050958ad357328742c69 /tests/test_main.py
parent4dc2a71af88d59b664a8bfdcfcc7acd6412bed76 (diff)
downloadisort-4384bc058968a83e095ae0ce14fafbff90fa4c1a.tar.gz
Add support for automatically skipping over fifo files
Diffstat (limited to 'tests/test_main.py')
-rw-r--r--tests/test_main.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_main.py b/tests/test_main.py
new file mode 100644
index 00000000..b3e50b54
--- /dev/null
+++ b/tests/test_main.py
@@ -0,0 +1,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)
+
+
+