diff options
author | theigel <theigel@yandex-team.ru> | 2022-02-10 16:50:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:31 +0300 |
commit | adb6b662413046d148a89e5d60ea5d0e3ea03b1f (patch) | |
tree | c91f5a91b1c09972ce0cc056554d241db59e8f92 | |
parent | 7ce8f58ec34c5182c7587acec452690c90e87362 (diff) | |
download | ydb-adb6b662413046d148a89e5d60ea5d0e3ea03b1f.tar.gz |
Restoring authorship annotation for <theigel@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | library/cpp/messagebus/www/messagebus.js | 2 | ||||
-rw-r--r-- | ydb/tests/library/matchers/response.py | 2 | ||||
-rw-r--r-- | ydb/tests/library/matchers/response_matchers.py | 34 |
3 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/messagebus/www/messagebus.js b/library/cpp/messagebus/www/messagebus.js index e30508b879..c832352a08 100644 --- a/library/cpp/messagebus/www/messagebus.js +++ b/library/cpp/messagebus/www/messagebus.js @@ -3,7 +3,7 @@ function logTransform(v) { } function plotHist(where, hist) { - var max = hist.map(function(x) {return x[1]}).reduce(function(x, y) {return Math.max(x, y)}); + var max = hist.map(function(x) {return x[1]}).reduce(function(x, y) {return Math.max(x, y)}); var ticks = []; for (var t = 1; ; t *= 10) { diff --git a/ydb/tests/library/matchers/response.py b/ydb/tests/library/matchers/response.py index d492116b4b..13d455c9f6 100644 --- a/ydb/tests/library/matchers/response.py +++ b/ydb/tests/library/matchers/response.py @@ -215,7 +215,7 @@ class KeyValueResponseProtobufMatcher(BaseMatcher): def is_response_with_status(status): - return ProtobufWithStatusMatcher(status) + return ProtobufWithStatusMatcher(status) def is_ok_response(): diff --git a/ydb/tests/library/matchers/response_matchers.py b/ydb/tests/library/matchers/response_matchers.py index 5fb2abcdfd..96b845c0a6 100644 --- a/ydb/tests/library/matchers/response_matchers.py +++ b/ydb/tests/library/matchers/response_matchers.py @@ -34,8 +34,8 @@ class FakeProtobuf(object): def __init__(self, **kwargs): self.__dict__['_data'] = dict() for k, v in iteritems(kwargs): - if v is not None: - setattr(self, k, v) + if v is not None: + setattr(self, k, v) def __getattr__(self, name): ret = self._data.get(name, None) @@ -53,9 +53,9 @@ class FakeProtobuf(object): def __getitem__(self, name): return self._data.get(name, None) - def __len__(self): + def __len__(self): return len(self._data) - + def __str__(self): return str(map(lambda x: (x[0], str(x[1])), iter(self))) @@ -107,7 +107,7 @@ class AbstractProtobufMatcher(BaseMatcher): def __match(self, matcher, actual_protobuf): if isinstance(matcher, BaseMatcher): - return matcher.matches(actual_protobuf) + return matcher.matches(actual_protobuf) elif isinstance(matcher, list): return len(actual_protobuf) == len(matcher) and \ all( @@ -115,22 +115,22 @@ class AbstractProtobufMatcher(BaseMatcher): for i, item in enumerate(matcher) ) else: - return all( - self.__match(value, getattr(actual_protobuf, name)) + return all( + self.__match(value, getattr(actual_protobuf, name)) for name, value in matcher - ) - + ) -class ProtobufWithStatusMatcher(AbstractProtobufMatcher): - def __init__(self, status=MessageBusStatus.MSTATUS_OK, error_code=None, error_reason=None): - super(ProtobufWithStatusMatcher, self).__init__() - self.expected_protobuf.Status = status - if error_code is not None: - self.expected_protobuf.ErrorCode = error_code - if error_reason is not None: - self.expected_protobuf.ErrorReason = error_reason +class ProtobufWithStatusMatcher(AbstractProtobufMatcher): + def __init__(self, status=MessageBusStatus.MSTATUS_OK, error_code=None, error_reason=None): + super(ProtobufWithStatusMatcher, self).__init__() + self.expected_protobuf.Status = status + if error_code is not None: + self.expected_protobuf.ErrorCode = error_code + if error_reason is not None: + self.expected_protobuf.ErrorReason = error_reason + class DynamicFieldsProtobufMatcher(AbstractProtobufMatcher): """ Highly dynamic matcher for Protobuf objects |