Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1080:d3a941ac4190
Date: 2012-11-30 10:43 -0800
http://bitbucket.org/cffi/cffi/changeset/d3a941ac4190/

Log:    Forgot to check in this test file.

diff --git a/testing/test_platform.py b/testing/test_platform.py
new file mode 100644
--- /dev/null
+++ b/testing/test_platform.py
@@ -0,0 +1,17 @@
+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
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to