summaryrefslogtreecommitdiff
path: root/tests/test_isort.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_isort.py')
-rw-r--r--tests/test_isort.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index 11a7079f..0228b414 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4627,6 +4627,44 @@ IF CEF_VERSION == 3:
SortImports(file_contents=test_input).output == expected_output
+def test_cdef_support():
+ assert (
+ SortImports(
+ file_contents="""
+from cpython.version cimport PY_MAJOR_VERSION
+
+cdef extern from *:
+ ctypedef CefString ConstCefString "const CefString"
+"""
+ ).output
+ == """
+from cpython.version cimport PY_MAJOR_VERSION
+
+
+cdef extern from *:
+ ctypedef CefString ConstCefString "const CefString"
+"""
+ )
+
+ assert (
+ SortImports(
+ file_contents="""
+from cpython.version cimport PY_MAJOR_VERSION
+
+cpdef extern from *:
+ ctypedef CefString ConstCefString "const CefString"
+"""
+ ).output
+ == """
+from cpython.version cimport PY_MAJOR_VERSION
+
+
+cpdef extern from *:
+ ctypedef CefString ConstCefString "const CefString"
+"""
+ )
+
+
def test_top_level_import_order() -> None:
test_input = (
"from rest_framework import throttling, viewsets\n"