diff tests/test_mock.py @ 225:ebb12ff21cb2

Updated unit tests to be able to run.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 12 Mar 2014 23:02:40 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_mock.py	Wed Mar 12 23:02:40 2014 -0700
@@ -0,0 +1,14 @@
+import pytest
+from .mock import MockFileSystem
+
+
+@pytest.mark.parametrize('flat, expected', [
+    ({}, {}),
+    ({'/foo.txt': 'Bar'}, {'foo.txt': 'Bar'}),
+    ({'/tmp/foo.txt': 'Bar'}, {'tmp': {'foo.txt': 'Bar'}}),
+    (
+        {'/tmp/foo.txt': 'Bar', '/tmp/bar': 'Foo'},
+        {'tmp': {'foo.txt': 'Bar', 'bar': 'Foo'}})])
+def test_flat_to_nested(flat, expected):
+    actual = MockFileSystem.flat_to_nested(flat)
+    assert actual == expected