Пример #1
0
 def test_prepare_db_not_overwrite(self):
     with self.assertRaisesRegex(FileExistsError,
                                 r'The file path .* exists.'):
         prepare_db(self.d, self.d)
Пример #2
0
 def test_prepare_db_not_overwrite(self):
     with self.assertRaisesRegex(
             FileExistsError, r'The file path .* exists.'):
         prepare_db(self.d, self.d)
Пример #3
0
 def test_prepare_db(self):
     prepare_db(self.tmp_dir, self.d)
     self._test_eq_db(self.obs_db_fp, self.exp_db_fp)
     with open(self.obs_pressed_fp, 'rb') as o:
         with open(self.exp_pressed_fp, 'rb') as e:
             self.assertEqual(o.read(), e.read())
Пример #4
0
 def test_prepare_db(self):
     prepare_db(self.tmp_dir, self.d)
     self._test_eq_db(self.obs_db_fp, self.exp_db_fp)
     with open(self.obs_pressed_fp, 'rb') as o:
         with open(self.exp_pressed_fp, 'rb') as e:
             self.assertEqual(o.read(), e.read())