Enhance integration test suite (#62)

* restructering, added helper, split cli tests for later

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* fixed threshold test

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* added acceptance tests to integration test suite

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* added different threshold signature test scenarios

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* started chain-migration test implementation

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* fixed linter errors

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>

* removed -s from test command

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger
2022-03-24 14:24:32 +01:00
committed by GitHub
parent f9f1a64773
commit df7c1e1ccf
19 changed files with 1151 additions and 71 deletions

View File

@@ -0,0 +1,36 @@
# Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from typing import List
from planetmint_driver import Planetmint
class Hosts:
hostnames = []
connections = []
def __init__(self, filepath):
self.set_hostnames(filepath=filepath)
self.set_connections()
def set_hostnames(self, filepath) -> None:
with open(filepath) as f:
self.hostnames = f.readlines()
def set_connections(self) -> None:
self.connections = list(map(lambda h: Planetmint(h), self.hostnames))
def get_connection(self, index=0) -> Planetmint:
return self.connections[index]
def get_transactions(self, tx_id) -> List:
return list(map(lambda connection: connection.transactions.retrieve(tx_id), self.connections))
def assert_transaction(self, tx_id) -> None:
txs = self.get_transactions(tx_id)
for tx in txs:
assert txs[0] == tx, \
'Cannot find transaction {}'.format(tx_id)