Skip to content

Commit

Permalink
Less brittle test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Rossi committed Oct 23, 2012
1 parent e3b18f1 commit 725e699
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions acidfs/tests.py
Expand Up @@ -278,15 +278,23 @@ def test_error_writing_blob(self):
fs = self.make_one()
with self.assertRaises((IOError, subprocess.CalledProcessError)):
with fs.open('foo', 'wb') as f:
shutil.rmtree(os.path.join(self.tmp, '.git'))
wait = f.raw.proc.wait
def dummy_wait():
wait()
return 1
f.raw.proc.wait = dummy_wait
fprint(f, b'Howdy!')

def test_error_reading_blob(self):
fs = self.make_one()
fs.open('foo', 'wb').write(b'a' * 10000)
with self.assertRaises(subprocess.CalledProcessError):
with fs.open('foo', 'rb') as f:
shutil.rmtree(os.path.join(self.tmp, '.git'))
wait = f.raw.proc.wait
def dummy_wait():
wait()
return 1
f.raw.proc.wait = dummy_wait
f.read()

def test_append(self):
Expand Down

0 comments on commit 725e699

Please sign in to comment.