aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortheigel <theigel@yandex-team.ru>2022-02-10 16:50:32 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:32 +0300
commitebfae0ebbb895e280d4efda81e07d3cf667c1625 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8
parentadb6b662413046d148a89e5d60ea5d0e3ea03b1f (diff)
downloadydb-ebfae0ebbb895e280d4efda81e07d3cf667c1625.tar.gz
Restoring authorship annotation for <theigel@yandex-team.ru>. Commit 2 of 2.
-rw-r--r--library/cpp/messagebus/www/messagebus.js2
-rw-r--r--ydb/tests/library/matchers/response.py2
-rw-r--r--ydb/tests/library/matchers/response_matchers.py34
3 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/messagebus/www/messagebus.js b/library/cpp/messagebus/www/messagebus.js
index c832352a08..e30508b879 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 13d455c9f6..d492116b4b 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 96b845c0a6..5fb2abcdfd 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