Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cover new edge cases.

  • Loading branch information...
commit d2771dee9cb1282cb5f3ef6c4f146e66c11b7f37 1 parent 7d4a49f
@chrisrossi chrisrossi authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 acidfs/tests.py
View
11 acidfs/tests.py
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.