climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1563517 - /incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py
Date Sat, 01 Feb 2014 23:57:10 GMT
Author: joyce
Date: Sat Feb  1 23:57:10 2014
New Revision: 1563517

URL: http://svn.apache.org/r1563517
Log:
Add valid directory cleaner helper test

Added:
    incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py

Added: incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py?rev=1563517&view=auto
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py (added)
+++ incubator/climate/trunk/ocw-ui/backend/tests/test_directory_helpers.py Sat Feb  1 23:57:10
2014
@@ -0,0 +1,19 @@
+import os
+import unittest
+from webtest import TestApp
+
+from ..run_webservices import app
+from ..directory_helpers import _get_clean_directory_path
+
+test_app = TestApp(app)
+
+class TestDirectoryPathCleaner(unittest.TestCase):
+    PATH_LEADER = '/tmp/foo'
+    VALID_CLEAN_DIR = '/tmp/foo/bar'
+
+    if not os.path.exists(PATH_LEADER): os.mkdir(PATH_LEADER)
+    if not os.path.exists(VALID_CLEAN_DIR): os.mkdir(VALID_CLEAN_DIR)
+
+    def test_valid_directory_path(self):
+        clean_path = _get_clean_directory_path(self.PATH_LEADER, '/bar')
+        self.assertEquals(clean_path, self.VALID_CLEAN_DIR)



Mime
View raw message