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