Browse Source

Restoring authorship annotation for <bur3@yandex-team.ru>. Commit 1 of 2.

bur3 3 years ago
parent
commit
21d4894ec3
8 changed files with 4246 additions and 4246 deletions
  1. 4167 4167
      certs/cacert.pem
  2. 35 35
      certs/tests/test_fetch.py
  3. 15 15
      certs/tests/ya.make
  4. 8 8
      certs/update-certs.py
  5. 12 12
      certs/ya.make
  6. 2 2
      util/string/cast.pxd
  7. 5 5
      util/string/cast_ut.pyx
  8. 2 2
      util/tests/cython/test_generic.py

File diff suppressed because it is too large
+ 4167 - 4167
certs/cacert.pem


+ 35 - 35
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() 

+ 15 - 15
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() 

+ 8 - 8
certs/update-certs.py

@@ -1,21 +1,21 @@
-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
-
-import urllib2
-
+#!/usr/bin/env python2 
+# -*- coding: utf-8 -*- 
+ 
+import urllib2 
+ 
 COMMON_ROOT_CAS_URL = "https://mkcert.org/generate"
 YANDEX_INTERNAL_CAS_URL = "https://crls.yandex.net/allCAs.pem"
-
+ 
 def get_text(url):
     return urllib2.urlopen(url).read()
-
+ 
 common_root_cas = get_text(COMMON_ROOT_CAS_URL)
 yandex_internal_cas = get_text(YANDEX_INTERNAL_CAS_URL)
 
 with open("cacert.pem", "wt") as target:
     target.write(common_root_cas)
     target.write(yandex_internal_cas)
-
+ 
 with open("yandex_internal.pem", "wt") as target:
     target.write(yandex_internal_cas)
 

+ 12 - 12
certs/ya.make

@@ -1,12 +1,12 @@
-LIBRARY()
-
-OWNER(
-    g:util
-    g:juggler
-)
-
-RESOURCE(
-    cacert.pem /builtin/cacert
-)
-
-END()
+LIBRARY() 
+ 
+OWNER( 
+    g:util 
+    g:juggler 
+) 
+ 
+RESOURCE( 
+    cacert.pem /builtin/cacert 
+) 
+ 
+END() 

+ 2 - 2
util/string/cast.pxd

@@ -3,8 +3,8 @@ from util.generic.string cimport TString
 from libcpp cimport bool as bool_t
 
 cdef extern from "<util/string/cast.h>" nogil:
-    T FromString[T](const TString&) except +
+    T FromString[T](const TString&) except + 
     bool_t TryFromString[T](const TString&, T&) except +
     TString ToString[T](const T&) except +
-
+ 
     cdef double StrToD(const char* b, char** se) except +

+ 5 - 5
util/string/cast_ut.pyx

@@ -1,13 +1,13 @@
 # cython: c_string_type=str, c_string_encoding=utf8
 
-from util.string.cast cimport FromString, ToString
+from util.string.cast cimport FromString, ToString 
 
 import unittest
 
-class TestFromString(unittest.TestCase):
-    def test_from_int(self):
-        self.assertEquals(FromString[int]("42"), 42)
-
+class TestFromString(unittest.TestCase): 
+    def test_from_int(self): 
+        self.assertEquals(FromString[int]("42"), 42) 
+ 
 class TestToString(unittest.TestCase):
     def test_from_int(self):
         self.assertEquals(ToString(42), "42")

+ 2 - 2
util/tests/cython/test_generic.py

@@ -10,7 +10,7 @@ from util.generic.maybe_ut import TestMaybe
 from util.generic.ptr_ut import TestHolder
 from util.generic.string_ut import TestStroka
 from util.generic.vector_ut import TestVector
-from util.string.cast_ut import TestFromString, TestToString
+from util.string.cast_ut import TestFromString, TestToString 
 
 # Test discovery does not work in cython modules.
 # Reexporting test classes here to satisfy pylint and pytest.
@@ -24,6 +24,6 @@ __all__ = [
     'TestMaybe',
     'TestStroka',
     'TestVector',
-    'TestFromString',
+    'TestFromString', 
     'TestToString',
 ]

Some files were not shown because too many files changed in this diff