示例#1
0
 def test_bug_is_there(self):
     test_bug = {
         'id': 1234,
         'last_change_time': 'john'
     }
     subject.store(test_bug)
     self.assertEqual('john', subject.last_mod(1234))
示例#2
0
 def test_store_existing_db(self):
     subject.init()
     subject.store({'id': 1233, 'data': 'otherjohn'})
     self.assertTrue(os.path.exists(local_pickle_file))
     subject.store({'id': 1234, 'data': 'john'})
     self.assertEqual(subject.bug_db['bugs'][1234]['data'], 'john')
     self.assertTrue(os.path.exists(local_pickle_file))
示例#3
0
 def setUp(self):
     subject.store({
         'id': 1234,
         'data': 'john'
     })
示例#4
0
 def test_store_str_id_non_parsable(self):
     with self.assertRaises(ValueError):
         subject.store({'id': 'bannana'})
示例#5
0
 def test_store_str_id_parsable(self):
     subject.store({'id': '1234'})
     self.assertEqual({'id': '1234'}, subject.bug_db['bugs'][1234])
示例#6
0
 def test_bug_absent_db_exists(self):
     subject.store({'id': 1235})
     self.assertTrue(subject.last_mod(1111) is None)