Commits

Armin Rigo  committed d3a941a

Forgot to check in this test file.

  • Participants
  • Parent commits 92bdeb9

Comments (0)

Files changed (1)

File testing/test_platform.py

+import os
+from cffi.ffiplatform import maybe_relative_path, flatten
+
+
+def test_not_absolute():
+    assert maybe_relative_path('foo/bar') == 'foo/bar'
+    assert maybe_relative_path('test_platform.py') == 'test_platform.py'
+
+def test_different_absolute():
+    p = os.path.join('..', 'baz.py')
+    assert maybe_relative_path(p) == p
+
+def test_absolute_mapping():
+    p = os.path.abspath('baz.py')
+    assert maybe_relative_path(p) == 'baz.py'
+    foobaz = os.path.join('foo', 'baz.py')
+    assert maybe_relative_path(os.path.abspath(foobaz)) == foobaz