Skip to content

Commit b0953d3

Browse files
committed
TST: Start adding tests for the wrapper functions
1 parent d3a9fce commit b0953d3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_wrapper.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Test the parts of the wrapper function."""
2+
3+
import glob
4+
import os.path
5+
6+
from check_python_h_first.wrapper import sort_order
7+
8+
THIS_DIR = os.path.dirname(__file__)
9+
10+
HEADER_LIST = glob.glob(os.path.join(THIS_DIR, "*.h"))
11+
SOURCE_LIST = glob.glob(os.path.join(THIS_DIR, "*.c"))
12+
13+
14+
def test_sort_order():
15+
"""Test that the sort function puts headers first."""
16+
result = sorted(SOURCE_LIST + HEADER_LIST, key=sort_order)
17+
assert result == HEADER_LIST + SOURCE_LIST

0 commit comments

Comments
 (0)