Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 3
0
 def setUp(self):
     subject.store({
         'id': 1234,
         'data': 'john'
     })
Exemplo n.º 4
0
 def test_store_str_id_non_parsable(self):
     with self.assertRaises(ValueError):
         subject.store({'id': 'bannana'})
Exemplo n.º 5
0
 def test_store_str_id_parsable(self):
     subject.store({'id': '1234'})
     self.assertEqual({'id': '1234'}, subject.bug_db['bugs'][1234])
Exemplo n.º 6
0
 def test_bug_absent_db_exists(self):
     subject.store({'id': 1235})
     self.assertTrue(subject.last_mod(1111) is None)