Exemple #1
0
 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))
Exemple #2
0
 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))
Exemple #3
0
 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)
Exemple #4
0
 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()))
Exemple #5
0
 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)
Exemple #6
0
 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))
Exemple #7
0
    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()))
Exemple #8
0
 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))
Exemple #9
0
 def test_disallow_instantiation(self):
     cx = sqlite.connect(":memory:")
     check_disallow_instantiation(self, type(cx("select 1")))
Exemple #10
0
 def test_disallow_instantiation(self):
     # Ensure that the type disallows instantiation (bpo-43916)
     check_disallow_instantiation(self, unicodedata.UCD)