about summary refs log tree commit diff stats
path: root/test/tc_directory.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-25 17:55:34 +0100
committerhut <hut@lavabit.com>2009-11-25 17:55:34 +0100
commit5822dff7d91472bf2fc337c68f144e0ce1de09ae (patch)
tree7d40218b67f13c9c95141aa5bcb4aa292c42924a /test/tc_directory.py
parentcfbb8c84355f28bc7f669105f90c7aae0a972569 (diff)
downloadranger-5822dff7d91472bf2fc337c68f144e0ce1de09ae.tar.gz
implemented more stuff
Diffstat (limited to 'test/tc_directory.py')
-rw-r--r--test/tc_directory.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/tc_directory.py b/test/tc_directory.py
index ebbd6b5e..88c7a99e 100644
--- a/test/tc_directory.py
+++ b/test/tc_directory.py
@@ -1,15 +1,15 @@
 import unittest
 import sys, os, time
-sys.path.append('../code')
-os.stat_float_times(True)
-import directory, fsobject, file, debug
 
-TESTDIR = os.path.realpath(os.path.join(os.path.dirname(sys.argv[0]), 'testdir'))
+sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../code')))
+import fsobject, file, directory
+
+TESTDIR = os.path.realpath(os.path.join(os.path.dirname(__file__), 'testdir'))
 TESTFILE = os.path.join(TESTDIR, 'testfile5234148')
 NONEXISTANT_DIR = '/this/directory/will/most/certainly/not/exist'
 
 class Test1(unittest.TestCase):
-	def testInitialCondition(self):
+	def test_initial_condition(self):
 		# Check for the expected initial condition
 		dir = directory.Directory(TESTDIR)
 
@@ -20,7 +20,7 @@ class Test1(unittest.TestCase):
 		self.assertRaises(fsobject.NotLoadedYet, len, dir)
 		self.assertRaises(fsobject.NotLoadedYet, dir.__getitem__, 0)
 
-	def testAfterContentLoaded(self):
+	def test_after_content_loaded(self):
 		# Check whether the directory has the correct list of filenames.
 		dir = directory.Directory(TESTDIR)
 		dir.load_content()
@@ -49,7 +49,7 @@ class Test1(unittest.TestCase):
 					equal += 1
 			self.assertEqual(equal, 1)
 
-	def testNonexistantDir(self):
+	def test_nonexistant_dir(self):
 		dir = directory.Directory(NONEXISTANT_DIR)
 		dir.load_content()
 		
@@ -60,7 +60,7 @@ class Test1(unittest.TestCase):
 		self.assertRaises(fsobject.NotLoadedYet, len, dir)
 		self.assertRaises(fsobject.NotLoadedYet, dir.__getitem__, 0)
 
-	def testModifyFrozenClone(self):
+	def test_modify_frozen_clone(self):
 		dir = directory.Directory(TESTDIR)
 		clone = dir.frozen_clone()
 
@@ -107,5 +107,6 @@ class Test1(unittest.TestCase):
 
 		self.assertTrue(dir.load_if_outdated())
 
-unittest.main()
+if __name__ == '__main__':
+	unittest.main()