diff options
author | bur3 <bur3@yandex-team.ru> | 2022-02-10 16:52:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:52:03 +0300 |
commit | 21d4894ec358934fd085d6ed0a177bf19aee27cc (patch) | |
tree | 03abeeefb9dd8239de553d07de972d660105e9ae /certs/tests | |
parent | fa2bf14034a6e0ee20178ad95dd1e6a80c0a61ac (diff) | |
download | ydb-21d4894ec358934fd085d6ed0a177bf19aee27cc.tar.gz |
Restoring authorship annotation for <bur3@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'certs/tests')
-rw-r--r-- | certs/tests/test_fetch.py | 70 | ||||
-rw-r--r-- | certs/tests/ya.make | 30 |
2 files changed, 50 insertions, 50 deletions
diff --git a/certs/tests/test_fetch.py b/certs/tests/test_fetch.py index 1a84a7a690..34e9085ff7 100644 --- a/certs/tests/test_fetch.py +++ b/certs/tests/test_fetch.py @@ -1,35 +1,35 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- - -from library.python import resource - -import pytest -import ssl -# import urllib2 - - -class TestRequest(object): - @pytest.fixture - def ctx(self): - r = resource.find("/builtin/cacert") - # ssl.create_default_context expects unicode string for pem-coded certificates - r = r.decode('ascii', errors='ignore') - return ssl.create_default_context(cadata=r) - - def test_certs(self, ctx): - assert any( - any(item[0] == ("commonName", "YandexInternalRootCA") for item in cert["subject"]) - for cert in ctx.get_ca_certs() - ) - assert any( - any(item[0] == ("commonName", "Certum Trusted Network CA") for item in cert["subject"]) - for cert in ctx.get_ca_certs() - ) - - # def test_internal(self, ctx): - # connection = urllib2.urlopen("https://nanny.yandex-team.ru/", context=ctx) - # assert connection.read() - - # def test_external(self, ctx): - # connection = urllib2.urlopen("https://docs.python.org/", context=ctx) - # assert connection.read() +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +from library.python import resource + +import pytest +import ssl +# import urllib2 + + +class TestRequest(object): + @pytest.fixture + def ctx(self): + r = resource.find("/builtin/cacert") + # ssl.create_default_context expects unicode string for pem-coded certificates + r = r.decode('ascii', errors='ignore') + return ssl.create_default_context(cadata=r) + + def test_certs(self, ctx): + assert any( + any(item[0] == ("commonName", "YandexInternalRootCA") for item in cert["subject"]) + for cert in ctx.get_ca_certs() + ) + assert any( + any(item[0] == ("commonName", "Certum Trusted Network CA") for item in cert["subject"]) + for cert in ctx.get_ca_certs() + ) + + # def test_internal(self, ctx): + # connection = urllib2.urlopen("https://nanny.yandex-team.ru/", context=ctx) + # assert connection.read() + + # def test_external(self, ctx): + # connection = urllib2.urlopen("https://docs.python.org/", context=ctx) + # assert connection.read() diff --git a/certs/tests/ya.make b/certs/tests/ya.make index 7064b67f51..f63f8985af 100644 --- a/certs/tests/ya.make +++ b/certs/tests/ya.make @@ -1,19 +1,19 @@ PY2TEST() - -OWNER( - g:util - g:juggler -) - + +OWNER( + g:util + g:juggler +) + TEST_SRCS(test_fetch.py) - -TAG(ya:external) - + +TAG(ya:external) + REQUIREMENTS(network:full) -PEERDIR( - library/python/resource - certs -) - -END() +PEERDIR( + library/python/resource + certs +) + +END() |