diff --git a/src/trafficgen/ship_traffic_generator.py b/src/trafficgen/ship_traffic_generator.py index 53d0e80..3c5cdc5 100644 --- a/src/trafficgen/ship_traffic_generator.py +++ b/src/trafficgen/ship_traffic_generator.py @@ -54,7 +54,7 @@ def generate_traffic_situations( title=desired_traffic_situation.title, input_file_name=desired_traffic_situation.input_file_name, common_vector=desired_traffic_situation.common_vector, - lat_lon_0=desired_traffic_situation.lat_lon_0, + lat_lon_0=encounter_settings.lat_lon_0, ) assert traffic_situation.common_vector is not None own_ship.start_pose = desired_traffic_situation.own_ship.start_pose diff --git a/tests/test_trafficgen.py b/tests/test_trafficgen.py index a043701..e9269a1 100644 --- a/tests/test_trafficgen.py +++ b/tests/test_trafficgen.py @@ -34,9 +34,7 @@ def test_basic_cli(): assert "Usage:" in result.output help_result = runner.invoke(cli.main, ["--help"]) assert help_result.exit_code == 0 - assert ( - "--help" in help_result.output and "Show this message and exit" in help_result.output - ) # noqa: E501 + assert "--help" in help_result.output and "Show this message and exit" in help_result.output # noqa: E501 def test_gen_situations_cli( @@ -124,6 +122,7 @@ def test_gen_situations_1_ts_full_spec_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) == 1 @@ -166,6 +165,7 @@ def test_gen_situations_1_ts_partly_spec_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None # @TODO: @TomArne: As again the tests on GitHub failed here, # I have for now adapted the assertion to not test for @@ -215,6 +215,7 @@ def test_gen_situations_1_ts_minimum_spec_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) == 1 @@ -256,6 +257,7 @@ def test_gen_situations_2_ts_one_to_many_situations_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) == 2 @@ -297,6 +299,7 @@ def test_gen_situations_one_to_many_situations_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) in {1, 2, 3} @@ -339,6 +342,7 @@ def test_gen_situations_ot_gw_target_ship_speed_too_high_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) == 0 @@ -381,5 +385,6 @@ def test_gen_situations_baseline_cli( # sourcery skip: no-loop-in-tests for situation in situations: + assert situation.lat_lon_0 is not None assert situation.target_ship is not None assert len(situation.target_ship) in {1, 2, 3}