(self)
| 105 | @unittest.skipUnless(os_helper.TESTFN_NONASCII, |
| 106 | 'requires OS support of non-ASCII encodings') |
| 107 | def test_nonascii_filename(self): |
| 108 | filename = os_helper.TESTFN_NONASCII |
| 109 | for suffix in ['', '.pag', '.dir', '.db']: |
| 110 | self.addCleanup(os_helper.unlink, filename + suffix) |
| 111 | with dbm.ndbm.open(filename, 'c') as db: |
| 112 | db[b'key'] = b'value' |
| 113 | self.assertTrue(any(os.path.exists(filename + suffix) |
| 114 | for suffix in ['', '.pag', '.dir', '.db'])) |
| 115 | with dbm.ndbm.open(filename, 'r') as db: |
| 116 | self.assertEqual(list(db.keys()), [b'key']) |
| 117 | self.assertTrue(b'key' in db) |
| 118 | self.assertEqual(db[b'key'], b'value') |
| 119 | |
| 120 | def test_nonexisting_file(self): |
| 121 | nonexisting_file = 'nonexisting-file' |
nothing calls this directly
no test coverage detected