Permalink
Browse files

Cover new edge cases.

  • Loading branch information...
1 parent 7d4a49f commit d2771dee9cb1282cb5f3ef6c4f146e66c11b7f37 @chrisrossi chrisrossi committed Oct 21, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 acidfs/tests.py
View
@@ -167,12 +167,23 @@ def test_open_edge_cases(self):
with self.assertRaises(ValueError):
fs.open('foo', 'wtf')
+ with self.assertRaises(ValueError):
+ fs.open('foo', 'wbt')
+
+ with self.assertRaises(ValueError):
+ fs.open('foo', 'w+')
+
with fs.open('bar', 'wb') as f:
fprint(f, b'Howdy!')
with self.assertRaises(ValueError) as cm:
transaction.commit()
self.assertEqual(str(cm.exception),
"Cannot commit transaction with open files.")
+ transaction.abort()
+
+ fs.open('bar', 'xb').write(b'Hello!')
+ with self.assertFileExists('bar'):
+ fs.open('bar', 'xb')
def test_mkdir_edge_cases(self):
fs = self.make_one()

0 comments on commit d2771de

Please sign in to comment.