summaryrefslogtreecommitdiff
path: root/src/integration-tests/gnunet_testing.py.in
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-19 00:35:44 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-19 00:35:44 +0100
commite7857ff6408f917a2ca57185def5596274569e11 (patch)
tree5958e7a60991a46a5a35c58dd862325a59d9dbb1 /src/integration-tests/gnunet_testing.py.in
parent0ca5d7e2a0d80732fcab9422281da7b80964da6b (diff)
cleaner py code, fix test_integration_disconnect.py.in by fixing erroneous patch
Diffstat (limited to 'src/integration-tests/gnunet_testing.py.in')
-rw-r--r--src/integration-tests/gnunet_testing.py.in12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in
index 5767a455a..639776fe0 100644
--- a/src/integration-tests/gnunet_testing.py.in
+++ b/src/integration-tests/gnunet_testing.py.in
@@ -170,13 +170,13 @@ class StatisticsCondition(Condition):
self.peer = peer
self.subsystem = subsystem
self.name = name
- self.value = value
+ self.value = str(value)
self.result = -1
def check(self):
if (self.fulfilled == False):
self.result = self.peer.get_statistics_value(self.subsystem, self.name)
- if (self.result == str(self.value)):
+ if (self.result == self.value):
self.fulfilled = True
return True
else:
@@ -206,7 +206,7 @@ class StatisticsCondition(Condition):
# op +
# res +
# fail)
- logger.debug('%s %s %s condition in subsystem %s : %s : (expected/real value) %s %s %s %s', self.peer.id[:4], self.peer.cfg.encode('utf-8'), str(self.type).encode('utf-8'), self.subsystem.encode('utf-8').ljust(12), self.name.encode('utf-8').ljust(30), str(self.value).encode('utf-8'), op, self.result, fail)
+ logger.debug('%s %s %s condition in subsystem %s : %s : (expected/real value) %s %s %s %s', self.peer.id[:4], self.peer.cfg, str(self.type), self.subsystem.ljust(12), self.name.ljust(30), self.value, op, self.result, fail)
return self.fulfilled
@@ -267,7 +267,7 @@ class EqualStatisticsCondition(Condition):
# self.name2.encode('utf-8').ljust(30) +
# b'" ' +
# self.result2)
- logger.debug('%s %s %s == %s %s %s %s %s', self.peer.id[:4], self.subsystem.encode('utf-8').ljust(12), self.name.encode('utf-8').ljust(30), self.result, self.peer2.id[:4], self.subsystem2.encode('uft-8').ljust(12), self.name2.encode('utf-8').ljust(30), self.result2)
+ logger.debug('%s %s %s == %s %s %s %s %s', self.peer.id[:4], self.subsystem.ljust(12), self.name.ljust(30), self.result, self.peer2.id[:4], self.subsystem2.ljust(12), self.name2.ljust(30), self.result2)
return self.fulfilled
@@ -375,12 +375,10 @@ class Peer(object):
if os.name == 'nt' and tests[1] == b'\n' and tests[0][-1] == b'\r':
tests = (tests[0][:-1], tests[1], tests[2])
tests = tests[0]
- # print("running gnunet-statistics " + self.cfg + " for " + name + "/" + subsystem + " yields " + tests.decode("utf-8"))
- logger.debug('running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, name, subsystem, test.decode("utf-8"))
result = tests.decode("utf-8").strip()
+ logger.debug('running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, name, subsystem, result)
if (result.isdigit() == True):
return result
else:
- # print("Invalid statistics value: " + str(tests) + " is not a number!")
logger.debug('Invalid statistics value: %s is not a number!', result)
return -1