Jan Kundrát
46f89aa770
coding style: autopep8 in an aggressive mode (-aaaaaaaaaa)
...
I decided to skip the following chunk of the diff because I think that
it would actually made the code a bit harder to read:
diff --git gnpy/core/service_sheet.py gnpy/core/service_sheet.py
index 9965840..9834111 100644
--- gnpy/core/service_sheet.py
+++ gnpy/core/service_sheet.py
@@ -41,8 +41,22 @@ logger = getLogger(__name__)
class Request(namedtuple('Request', 'request_id source destination trx_type mode \
spacing power nb_channel disjoint_from nodes_list is_loose path_bandwidth')):
- def __new__(cls, request_id, source, destination, trx_type, mode=None, spacing=None, power=None, nb_channel=None, disjoint_from='', nodes_list=None, is_loose='', path_bandwidth=None):
- return super().__new__(cls, request_id, source, destination, trx_type, mode, spacing, power, nb_channel, disjoint_from, nodes_list, is_loose, path_bandwidth)
+ def __new__(
+ cls,
+ request_id,
+ source,
+ destination,
+ trx_type,
+ mode=None,
+ spacing=None,
+ power=None,
+ nb_channel=None,
+ disjoint_from='',
+ nodes_list=None,
+ is_loose='',
+ path_bandwidth=None):
+ return super().__new__(cls, request_id, source, destination, trx_type, mode, spacing,
+ power, nb_channel, disjoint_from, nodes_list, is_loose, path_bandwidth)
# Type for output data: // from dutc
diff --git tests/test_automaticmodefeature.py tests/test_automaticmodefeature.py
index 0e5f633..5ba5881 100644
--- tests/test_automaticmodefeature.py
+++ tests/test_automaticmodefeature.py
@@ -32,7 +32,26 @@ eqpt_library_name = Path(__file__).parent.parent / 'tests/data/eqpt_config.json'
@pytest.mark.parametrize("net", [network_file_name])
@pytest.mark.parametrize("eqpt", [eqpt_library_name])
@pytest.mark.parametrize("serv", [service_file_name])
-@pytest.mark.parametrize("expected_mode", [['16QAM', 'PS_SP64_1', 'PS_SP64_1', 'PS_SP64_1', 'mode 2 - fake', 'mode 2', 'PS_SP64_1', 'mode 3', 'PS_SP64_1', 'PS_SP64_1', '16QAM', 'mode 1', 'PS_SP64_1', 'PS_SP64_1', 'mode 1', 'mode 2', 'mode 1', 'mode 2', 'nok']])
+@pytest.mark.parametrize("expected_mode",
+ [['16QAM',
+ 'PS_SP64_1',
+ 'PS_SP64_1',
+ 'PS_SP64_1',
+ 'mode 2 - fake',
+ 'mode 2',
+ 'PS_SP64_1',
+ 'mode 3',
+ 'PS_SP64_1',
+ 'PS_SP64_1',
+ '16QAM',
+ 'mode 1',
+ 'PS_SP64_1',
+ 'PS_SP64_1',
+ 'mode 1',
+ 'mode 2',
+ 'mode 1',
+ 'mode 2',
+ 'nok']])
def test_automaticmodefeature(net, eqpt, serv, expected_mode):
equipment = load_equipment(eqpt)
network = load_network(net, equipment)
Change-Id: I522c45c079b3a9540568657e2ae0a4bfc5fb1272
2020-05-19 12:53:11 +02:00