aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing/yatest_lib/external.py
diff options
context:
space:
mode:
authorAleksandr <ivansduck@gmail.com>2022-02-10 16:47:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:52 +0300
commitb05913d1c3c02a773578bceb7285084d2933ae86 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /library/python/testing/yatest_lib/external.py
parentea6c5b7f172becca389cacaff7d5f45f6adccbe6 (diff)
downloadydb-b05913d1c3c02a773578bceb7285084d2933ae86.tar.gz
Restoring authorship annotation for Aleksandr <ivansduck@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/python/testing/yatest_lib/external.py')
-rw-r--r--library/python/testing/yatest_lib/external.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/library/python/testing/yatest_lib/external.py b/library/python/testing/yatest_lib/external.py
index 69874dece4..39113230d9 100644
--- a/library/python/testing/yatest_lib/external.py
+++ b/library/python/testing/yatest_lib/external.py
@@ -1,20 +1,20 @@
from __future__ import absolute_import
-import re
+import re
import sys
import copy
-import logging
+import logging
from . import tools
from datetime import date, datetime
-import enum
+import enum
import six
-logger = logging.getLogger(__name__)
-MDS_URI_PREFIX = 'https://storage.yandex-team.ru/get-devtools/'
+logger = logging.getLogger(__name__)
+MDS_URI_PREFIX = 'https://storage.yandex-team.ru/get-devtools/'
+
-
def apply(func, value, apply_to_keys=False):
"""
Applies func to every possible member of value
@@ -67,8 +67,8 @@ def serialize(value):
return val
if isinstance(val, six.string_types) or isinstance(val, bytes):
return tools.to_utf8(val)
- if isinstance(val, enum.Enum):
- return str(val)
+ if isinstance(val, enum.Enum):
+ return str(val)
if isinstance(val, six.integer_types) or type(val) in [float, bool]:
return val
if is_external(val):
@@ -136,19 +136,19 @@ class ExternalDataInfo(object):
@property
def path(self):
- if self.uri.count("://") != 1:
- logger.error("Invalid external data uri: '%s'", self.uri)
- return self.uri
+ if self.uri.count("://") != 1:
+ logger.error("Invalid external data uri: '%s'", self.uri)
+ return self.uri
_, path = self.uri.split("://")
return path
- def get_mds_key(self):
- assert self.is_http
- m = re.match(re.escape(MDS_URI_PREFIX) + r'(.*?)($|#)', self.uri)
- if m:
- return m.group(1)
- raise AssertionError("Failed to extract mds key properly from '{}'".format(self.uri))
-
+ def get_mds_key(self):
+ assert self.is_http
+ m = re.match(re.escape(MDS_URI_PREFIX) + r'(.*?)($|#)', self.uri)
+ if m:
+ return m.group(1)
+ raise AssertionError("Failed to extract mds key properly from '{}'".format(self.uri))
+
@property
def size(self):
return self._data.get("size")