diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-07-29 13:17:42 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-07-29 13:17:42 +0100 |
commit | e57864f5f7fa200691177b02fc09a73a7962e9c0 (patch) | |
tree | 6071f667944037250aabeb404e271557d5421bbd | |
parent | 6b10f1826dcd1037006db0fe7155ebddeea5f825 (diff) | |
download | obnam-e57864f5f7fa200691177b02fc09a73a7962e9c0.tar.gz |
Change lstat test to verify all necessary fields are present.
-rw-r--r-- | obnamlib/vfs.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/obnamlib/vfs.py b/obnamlib/vfs.py index 0d7c36a3..25c443c2 100644 --- a/obnamlib/vfs.py +++ b/obnamlib/vfs.py @@ -443,8 +443,11 @@ class VfsTests(object): # pragma: no cover self.fs.rename('foo', 'bar') self.assertEqual(self.fs.cat('bar'), 'foo') - def test_lstat_returns_result(self): - self.assert_(self.fs.lstat('.')) + def test_lstat_returns_result_with_all_required_fields(self): + st = self.fs.lstat('.') + for field in obnamlib.metadata_fields: + if field.startswith('st_'): + self.assert_(hasattr(st, field), 'stat must return %s' % field) def test_lstat_raises_oserror_for_nonexistent_entry(self): self.assertRaises(OSError, self.fs.lstat, 'notexists') |