def test_disallow_instantiation(self): for algorithm, constructors in self.constructors_to_test.items(): if algorithm.startswith(("sha3_", "shake", "blake")): # _sha3 and _blake types can be instantiated continue # all other types have DISALLOW_INSTANTIATION for constructor in constructors: h = constructor() with self.subTest(constructor=constructor): support.check_disallow_instantiation(self, type(h))
def test_disallow_instantiation(self): for algorithm, constructors in self.constructors_to_test.items(): if algorithm.startswith(("sha3_", "shake", "blake")): # _sha3 and _blake types can be instantiated continue # all other types have DISALLOW_INSTANTIATION for constructor in constructors: # In FIPS mode some algorithms are not available raising ValueError try: h = constructor() except ValueError: continue with self.subTest(constructor=constructor): support.check_disallow_instantiation(self, type(h))
def test_hash_disallow_instantiation(self): # internal types like _hashlib.HASH are not constructable support.check_disallow_instantiation(self, HASH) support.check_disallow_instantiation(self, HASHXOF)
def test_disallow_instantiation(self): # Ensure that the type disallows instantiation (bpo-43916) support.check_disallow_instantiation(self, type(zlib.compressobj())) support.check_disallow_instantiation(self, type(zlib.decompressobj()))
def test_new_tcl_obj(self): support.check_disallow_instantiation(self, _tkinter.Tcl_Obj) support.check_disallow_instantiation(self, _tkinter.TkttType) support.check_disallow_instantiation(self, _tkinter.TkappType)
def test_disallow_instantiation(self): # Ensure that the type disallows instantiation (bpo-43916) w = curses.newwin(10, 10) panel = curses.panel.new_panel(w) check_disallow_instantiation(self, type(panel))
def test_disallow_instantiation(self): support.check_disallow_instantiation(self, type(select.poll())) if hasattr(select, 'devpoll'): support.check_disallow_instantiation(self, type(select.devpoll()))
def test_disallow_instantiation(self): # Ensure that the type disallows instantiation (bpo-43916) self.g = gdbm.open(filename, 'c') support.check_disallow_instantiation(self, type(self.g))
def test_disallow_instantiation(self): cx = sqlite.connect(":memory:") check_disallow_instantiation(self, type(cx("select 1")))
def test_disallow_instantiation(self): # Ensure that the type disallows instantiation (bpo-43916) check_disallow_instantiation(self, unicodedata.UCD)