Changeset View
Changeset View
Standalone View
Standalone View
test/functional/example_test.py
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | def custom_function(): | ||||
moving it to a module in test_framework.""" | moving it to a module in test_framework.""" | ||||
# self.log.info("running custom_function") # Oops! Can't run self.log outside the BitcoinTestFramework | # self.log.info("running custom_function") # Oops! Can't run self.log outside the BitcoinTestFramework | ||||
pass | pass | ||||
class ExampleTest(BitcoinTestFramework): | class ExampleTest(BitcoinTestFramework): | ||||
# Each functional test is a subclass of the BitcoinTestFramework class. | # Each functional test is a subclass of the BitcoinTestFramework class. | ||||
# Override the set_test_params(), add_options(), setup_chain(), setup_network() | # Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network() | ||||
# and setup_nodes() methods to customize the test setup as required. | # and setup_nodes() methods to customize the test setup as required. | ||||
def set_test_params(self): | def set_test_params(self): | ||||
"""Override test parameters for your individual test. | """Override test parameters for your individual test. | ||||
This method must be overridden and num_nodes must be exlicitly set.""" | This method must be overridden and num_nodes must be exlicitly set.""" | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
self.num_nodes = 3 | self.num_nodes = 3 | ||||
# Use self.extra_args to change command-line arguments for the nodes | # Use self.extra_args to change command-line arguments for the nodes | ||||
self.extra_args = [[], ["-logips"], []] | self.extra_args = [[], ["-logips"], []] | ||||
# self.log.info("I've finished set_test_params") # Oops! Can't run self.log before run_test() | # self.log.info("I've finished set_test_params") # Oops! Can't run self.log before run_test() | ||||
def skip_test_if_missing_module(self): | |||||
self.skip_if_no_wallet() | |||||
# Use add_options() to add specific command-line options for your test. | # Use add_options() to add specific command-line options for your test. | ||||
# In practice this is not used very much, since the tests are mostly written | # In practice this is not used very much, since the tests are mostly written | ||||
# to be run in automated environments without command-line options. | # to be run in automated environments without command-line options. | ||||
# def add_options() | # def add_options() | ||||
# pass | # pass | ||||
# Use setup_chain() to customize the node data directories. In practice | # Use setup_chain() to customize the node data directories. In practice | ||||
# this is not used very much since the default behaviour is almost always | # this is not used very much since the default behaviour is almost always | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |