Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
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)
Example #5
0
 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)
Example #6
0
 def test_destructor(self, mocked):
     new_set = OIDSet()
     del new_set
     gc.collect()
     self.assertEqual(mocked.call_count, 1)
Example #7
0
 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)
Example #8
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)