|
12 | 12 | ROOT_DIR = Path(__file__).resolve().parents[1] |
13 | 13 |
|
14 | 14 |
|
15 | | -def get_settings(filepath, output, ork): |
16 | | - bs, _ = parse_ork_file(filepath) |
| 15 | +def get_settings(ork_filepath, output_dir, ork_document): |
| 16 | + bs, _ = parse_ork_file(ork_filepath) |
17 | 17 |
|
18 | | - output.mkdir(parents=True, exist_ok=True) |
| 18 | + output_dir.mkdir(parents=True, exist_ok=True) |
19 | 19 |
|
20 | 20 | settings = ork_extractor( |
21 | 21 | bs=bs, |
22 | | - filepath=str(filepath), |
23 | | - output_folder=str(output), |
24 | | - ork=ork, |
| 22 | + filepath=str(ork_filepath), |
| 23 | + output_folder=str(output_dir), |
| 24 | + ork=ork_document, |
25 | 25 | ) |
26 | 26 | return settings |
27 | 27 |
|
28 | 28 |
|
29 | 29 | with OpenRocketSession(select_latest_openrocket_jar(ROOT_DIR), "OFF") as session: |
30 | | - |
31 | 30 | # Valetudo 2019 |
32 | | - filepath = ROOT_DIR / "examples" / "ProjetoJupiter--Valetudo--2019" / "rocket.ork" |
33 | | - filepath = extract_ork_from_zip(filepath, filepath.parent) |
34 | | - output = ROOT_DIR / "tests" / "acceptance" / "ProjetoJupiter--Valetudo--2019" |
35 | | - ork = session.load_doc(str(filepath)) |
36 | | - settings1 = get_settings(filepath, output, ork) |
| 31 | + valetudo_filepath = ( |
| 32 | + ROOT_DIR / "examples" / "ProjetoJupiter--Valetudo--2019" / "rocket.ork" |
| 33 | + ) |
| 34 | + valetudo_filepath = extract_ork_from_zip( |
| 35 | + valetudo_filepath, valetudo_filepath.parent |
| 36 | + ) |
| 37 | + valetudo_output_dir = ( |
| 38 | + ROOT_DIR / "tests" / "acceptance" / "ProjetoJupiter--Valetudo--2019" |
| 39 | + ) |
| 40 | + valetudo_doc = session.load_doc(str(valetudo_filepath)) |
| 41 | + settings1 = get_settings(valetudo_filepath, valetudo_output_dir, valetudo_doc) |
37 | 42 |
|
38 | 43 | @pytest.fixture() |
39 | 44 | def valetudo_settings(): |
40 | 45 | return settings1 |
41 | 46 |
|
42 | 47 | # NDRT 2020 |
43 | | - filepath = ROOT_DIR / "examples" / "NDRT--Rocket--2020" / "rocket.ork" |
44 | | - filepath = extract_ork_from_zip(filepath, filepath.parent) |
45 | | - output = ROOT_DIR / "tests" / "acceptance" / "NDRT--Rocket--2020" |
46 | | - ork = session.load_doc(str(filepath)) |
47 | | - settings2 = get_settings(filepath, output, ork) |
| 48 | + ndrt_filepath = ROOT_DIR / "examples" / "NDRT--Rocket--2020" / "rocket.ork" |
| 49 | + ndrt_filepath = extract_ork_from_zip(ndrt_filepath, ndrt_filepath.parent) |
| 50 | + ndrt_output_dir = ROOT_DIR / "tests" / "acceptance" / "NDRT--Rocket--2020" |
| 51 | + ndrt_doc = session.load_doc(str(ndrt_filepath)) |
| 52 | + settings2 = get_settings(ndrt_filepath, ndrt_output_dir, ndrt_doc) |
48 | 53 |
|
49 | 54 | @pytest.fixture() |
50 | 55 | def ndrt_settings(): |
51 | 56 | return settings2 |
52 | 57 |
|
53 | 58 | # Bella Lui 2020 |
54 | | - filepath = ROOT_DIR / "examples" / "EPFL--BellaLui--2020" / "rocket.ork" |
55 | | - filepath = extract_ork_from_zip(filepath, filepath.parent) |
56 | | - output = ROOT_DIR / "tests" / "acceptance" / "EPFL--BellaLui--2020" |
57 | | - ork = session.load_doc(str(filepath)) |
58 | | - settings3 = get_settings(filepath, output, ork) |
| 59 | + epfl_filepath = ROOT_DIR / "examples" / "EPFL--BellaLui--2020" / "rocket.ork" |
| 60 | + epfl_filepath = extract_ork_from_zip(epfl_filepath, epfl_filepath.parent) |
| 61 | + epfl_output_dir = ROOT_DIR / "tests" / "acceptance" / "EPFL--BellaLui--2020" |
| 62 | + epfl_doc = session.load_doc(str(epfl_filepath)) |
| 63 | + settings3 = get_settings(epfl_filepath, epfl_output_dir, epfl_doc) |
59 | 64 |
|
60 | 65 | @pytest.fixture() |
61 | 66 | def epfl_settings(): |
|
0 commit comments