示例#1
0
    def test_RAND_egd(self):
        import _ssl
        if not hasattr(_ssl, "RAND_egd"):
            skip("RAND_egd is not available on this machine")
        raises(TypeError, _ssl.RAND_egd, 4)

        # you need to install http://egd.sourceforge.net/ to test this
        # execute "egd.pl entropy" in the current dir
        _ssl.RAND_egd("entropy")
示例#2
0
def test_RAND_egd():
    #--Positive
    if not is_cpython:
        AreEqual(real_ssl.RAND_egd(""), None)

    #--Negative
    AssertError(TypeError, real_ssl.RAND_egd)
    AssertError(TypeError, real_ssl.RAND_add, None)
    AssertError(TypeError, real_ssl.RAND_add, 1)
    AssertError(TypeError, real_ssl.RAND_add, 3.14)
    AssertError(TypeError, real_ssl.RAND_add, "", "")
示例#3
0
    def test_RAND_egd(self):
        import _ssl, os, stat
        if not hasattr(_ssl, "RAND_egd"):
            skip("RAND_egd is not available on this machine")
        raises(TypeError, _ssl.RAND_egd, 4)

        # you need to install http://egd.sourceforge.net/ to test this
        # execute "egd.pl entropy" in the current dir
        if (not os.access("entropy", 0)
                or not stat.S_ISSOCK(os.stat("entropy").st_mode)):
            skip("This test needs a running entropy gathering daemon")
        _ssl.RAND_egd("entropy")