def test_ne(self): allmechs = get_all_mechs() if len(allmechs) < 2: self.skipTest("Only one available mechanism.") else: singleton_set1 = OIDSet.singleton_set(allmechs[0]) singleton_set2 = OIDSet.singleton_set(allmechs[-1]) self.assertNotEqual(singleton_set1, singleton_set2)
def test_length(self): self.assertEqual(len(OIDSet()), 0) new_set = OIDSet() new_set._oid_set = ffi.new('gss_OID_set[1]') self.assertEqual(len(new_set), 0)
def check_singleton_set(self, mech, allmechs): s = OIDSet.singleton_set(mech) self.assertIn(mech, s) for other in allmechs: if other != mech: self.assertNotIn(other, s)
def test_doublefree(self, mocked): new_set = OIDSet() _release_OID_set(new_set._oid_set) _release_OID_set(new_set._oid_set) self.assertEqual(mocked.call_count, 1)
def test_destructor(self, mocked): new_set = OIDSet() del new_set gc.collect() self.assertEqual(mocked.call_count, 1)