Reading and comparing a whole file node.
(self)
| 395 | super().tearDown() |
| 396 | |
| 397 | def test00_CompareFile(self): |
| 398 | """Reading and comparing a whole file node.""" |
| 399 | |
| 400 | import hashlib |
| 401 | |
| 402 | dfiledigest = hashlib.md5(self.datafile.read()).digest() |
| 403 | fnodedigest = hashlib.md5(self.fnode.read()).digest() |
| 404 | |
| 405 | self.assertEqual( |
| 406 | dfiledigest, |
| 407 | fnodedigest, |
| 408 | "Data read from file node differs from that in the file on disk.", |
| 409 | ) |
| 410 | |
| 411 | def test01_Write(self): |
| 412 | """Writing on a read-only file.""" |