diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-11 15:12:07 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-11 15:12:07 +0200 |
commit | 4e6b5077d0df3220057c79631d24876d15ed2b83 (patch) | |
tree | 4d57e9ab1f670b92bd957975cbb0855caff63c76 /selftest | |
parent | b1d8d30526e49a4f2c8d89c0b35b78d2625a9145 (diff) |
Split Scenario class to its own file
Change-Id: Ia029de7ecda4c8dc3d0b4c412e4c9c0a65cf0185
Diffstat (limited to 'selftest')
-rwxr-xr-x | selftest/suite_test/suite_test.py | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/selftest/suite_test/suite_test.py b/selftest/suite_test/suite_test.py index fc5f9df..a096027 100755 --- a/selftest/suite_test/suite_test.py +++ b/selftest/suite_test/suite_test.py @@ -3,7 +3,11 @@ import os import sys import _prep import shutil -from osmo_gsm_tester.core import log, config, util, report +from osmo_gsm_tester.core import log +from osmo_gsm_tester.core import config +from osmo_gsm_tester.core import util +from osmo_gsm_tester.core import report +from osmo_gsm_tester.core import scenario from osmo_gsm_tester.core import suite from osmo_gsm_tester.core.schema import generate_schemas, get_all_schema @@ -66,26 +70,26 @@ print(output) print('- test with half empty scenario') trial = FakeTrial() -scenario = config.Scenario('foo', 'bar') -scenario['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] } -s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +sc = scenario.Scenario('foo', 'bar') +sc['resources'] = { 'bts': [{'type': 'osmo-bts-trx'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [sc]) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) print('- test with scenario') trial = FakeTrial() -scenario = config.Scenario('foo', 'bar') -scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } -s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +sc = scenario.Scenario('foo', 'bar') +sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [sc]) results = s.run_tests('hello_world.py') print(report.suite_to_text(s)) print('- test with scenario and modifiers') trial = FakeTrial() -scenario = config.Scenario('foo', 'bar') -scenario['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } -scenario['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': [{'nominal_power': '20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] } -s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +sc = scenario.Scenario('foo', 'bar') +sc['resources'] = { 'bts': [{ 'times': '2', 'type': 'osmo-bts-trx', 'trx_list': [{'nominal_power': '10'}, {'nominal_power': '12'}]}, {'type': 'sysmo'}] } +sc['modifiers'] = { 'bts': [{ 'times': '2', 'trx_list': [{'nominal_power': '20'}, {'nominal_power': '20'}]}, {'type': 'sysmo'}] } +s = suite.SuiteRun(trial, 'test_suite', s_def, [sc]) s.reserve_resources() print(repr(s.reserved_resources)) results = s.run_tests('hello_world.py') @@ -93,9 +97,9 @@ print(report.suite_to_text(s)) print('- test with suite-specific config') trial = FakeTrial() -scenario = config.Scenario('foo', 'bar') -scenario['config'] = {'suite': {s.name(): { 'some_suite_global_param': 'heyho', 'test_suite_params': {'one_bool_parameter': 'true', 'second_list_parameter': ['23', '45']}}}} -s = suite.SuiteRun(trial, 'test_suite', s_def, [scenario]) +sc = scenario.Scenario('foo', 'bar') +sc['config'] = {'suite': {s.name(): { 'some_suite_global_param': 'heyho', 'test_suite_params': {'one_bool_parameter': 'true', 'second_list_parameter': ['23', '45']}}}} +s = suite.SuiteRun(trial, 'test_suite', s_def, [sc]) s.reserve_resources() print(repr(s.reserved_resources)) results = s.run_tests('test_suite_params.py') |