def test_not_eq(self): a = Sentinel() b = Sentinel(a.id, a.name + 'moira') self.assertNotEqual(hash(a), hash(b)) a.id += 'bolivar' self.assertNotEqual(hash(a), hash(b))
def test_eq(self): a = Sentinel() b = Sentinel(name=a.name) self.assertEqual(hash(a), hash(b)) b.id += 'moira' self.assertEqual(hash(a), hash(b))
def test_invalid_add(self): master_mold = MasterMold() a = Sentinel() b = Sentinel(a.id, a.name) master_mold.add_sentinel(a) self.assertRaises(sqlite3.IntegrityError, master_mold.add_sentinel, b)
def test_get(self): master_mold = MasterMold() master_mold.add_sentinel(Sentinel(id='rockets', name='gas')) master_mold.add_sentinel(Sentinel(id='stomp', name='palm beam')) master_mold.add_sentinel(Sentinel(id='eye beams', name='bomb')) self.assertEqual(len(master_mold.get_sentinels(1)), 1) self.assertEqual(len(master_mold.get_sentinels(2)), 2) self.assertEqual(len(master_mold.get_sentinels(3)), 3) self.assertEqual(len(master_mold.get_sentinels()), 3)
def test_add_get(self): master_mold = MasterMold() sentinel = Sentinel() master_mold.add_sentinel(sentinel) sentinels = master_mold.get_sentinels() self.assertEqual(len(sentinels), 1) self.assertEqual(sentinels[0], sentinel)
def test_hash(self): a = Sentinel() self.assertIsNotNone(hash(a))
def test_not_eq(self): a = Sentinel() b = Sentinel(a.id + 'bolivar', a.name + 'moira') self.assertNotEqual(a, b)
def test_eq(self): a = Sentinel() b = Sentinel(a.id, a.name) self.assertEqual(a, b)