Esempio n. 1
0
    def test_with_ca(self):
        d = self.tmpdir()
        cacert = os.path.join(d, "foo/cert.cnf")
        assert certutils.dummy_ca(cacert)
        p = certutils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com", ["one.com", "two.com", "*.three.com"])
        assert os.path.exists(p)

        # Short-circuit
        assert certutils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com", [])
Esempio n. 2
0
 def test_no_ca(self):
     d = self.tmpdir()
     p = certutils.dummy_cert(
         d,
         None,
         "foo.com",
         []
     )
     assert os.path.exists(p)
Esempio n. 3
0
 def test_no_ca(self):
     d = self.tmpdir()
     p = certutils.dummy_cert(
         d,
         None,
         "foo.com",
         []
     )
     assert os.path.exists(p)
Esempio n. 4
0
    def test_with_ca(self):
        d = self.tmpdir()
        cacert = os.path.join(d, "foo/cert.cnf")
        assert certutils.dummy_ca(cacert)
        p = certutils.dummy_cert(
            os.path.join(d, "foo"),
            cacert,
            "foo.com",
            ["one.com", "two.com", "*.three.com"]
        )
        assert os.path.exists(p)

        # Short-circuit
        assert certutils.dummy_cert(
            os.path.join(d, "foo"),
            cacert,
            "foo.com",
            []
        )