Пример #1
0
    def test_202(self):
        splice_conn = SpliceConnection(host="127.0.0.1", ssl_port=443, handler='/foo', rhic='/foo/bar',
                            insecure=True, ca_cert_dir='/baz', rhic_ca_cert='/qux')

        splice_conn.conn = StubRestlib(202)

        with self.assertRaises(AcceptedException):
            splice_conn.getCerts(identity_cert=StubRhic(), consumer_identifier=None)
Пример #2
0
    def test_404(self):
        splice_conn = SpliceConnection(host="127.0.0.1", ssl_port=443, handler='/foo', rhic='/foo/bar',
                            insecure=True, ca_cert_dir='/baz', rhic_ca_cert='/qux')

        splice_conn.conn = StubRestlib(404)

        with self.assertRaises(RemoteServerException) as rse:
            splice_conn.getCerts(identity_cert=StubRhic(), consumer_identifier=None)

        self.assertEqual(rse.exception.code, 404)