Commit e8a7bd9e by willmcgugan

Some changes to the tests

parent aab21a9f
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import unittest import unittest
import fs import fs
import shutil
class TestHelpers(unittest.TestCase): class TestHelpers(unittest.TestCase):
...@@ -125,7 +126,7 @@ class TestObjectTree(unittest.TestCase): ...@@ -125,7 +126,7 @@ class TestObjectTree(unittest.TestCase):
ot['a/b/e'] = "C" ot['a/b/e'] = "C"
ot['a/b/f'] = "D" ot['a/b/f'] = "D"
self.assertEqual(sorted(ot['a/b'].values()), ['A', 'B', 'C', 'D']) self.assertEqual(sorted(ot['a/b'].values()), ['A', 'B', 'C', 'D'])
self.assert_(ot.get('a/b/x', None) is None) self.assert_(ot.get('a/b/x', -1) == -1)
self.assert_('a/b/c' in ot) self.assert_('a/b/c' in ot)
self.assert_('a/b/x' not in ot) self.assert_('a/b/x' not in ot)
...@@ -154,12 +155,7 @@ class TestFS(unittest.TestCase): ...@@ -154,12 +155,7 @@ class TestFS(unittest.TestCase):
def tearDown(self): def tearDown(self):
assert "fstest" in self.temp_dir assert "fstest" in self.temp_dir
for root, dirs, files in os.walk(self.temp_dir, topdown=False): shutil.rmtree(self.temp_dir)
for f in files:
os.remove(os.path.join(root, f))
for d in dirs:
os.rmdir(os.path.join(root, d))
os.removedirs(self.temp_dir)
def check(self, p): def check(self, p):
return os.path.exists(os.path.join(self.temp_dir, p)) return os.path.exists(os.path.join(self.temp_dir, p))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment