Пример #1
0
    def test_certificate_invalid(self):
        error_messages = []
        cert = 'nope'

        configuration._validate_certificate('cert', cert, error_messages)

        self.assertEqual(len(error_messages), 1)
Пример #2
0
    def test_certificate_invalid(self):
        error_messages = []
        cert = 'nope'

        configuration._validate_certificate('cert', cert, error_messages)

        self.assertEqual(len(error_messages), 1)
Пример #3
0
    def test_certificate(self):

        test_ca_path = os.path.join(DATA_DIR, 'test_ca.crt')
        with open(test_ca_path, 'r') as test_ca_handle:
            error_messages = []
            ca_cert = test_ca_handle.read()

            configuration._validate_certificate('cert', ca_cert, error_messages)

            self.assertEqual(len(error_messages), 0)
Пример #4
0
    def test_certificate(self):

        test_ca_path = os.path.join(DATA_DIR, 'test_ca.crt')
        with open(test_ca_path, 'r') as test_ca_handle:
            error_messages = []
            ca_cert = test_ca_handle.read()

            configuration._validate_certificate('cert', ca_cert, error_messages)

            self.assertEqual(len(error_messages), 0)