-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcampaign_checker.py
118 lines (100 loc) · 4.84 KB
/
campaign_checker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
"""This module is the top-level file to run for the Campaign Checker
Imports From:
os
campaigns_parser.py
report.py
test_campaign_data.py
test_award_event_files.py
test_campaign_data_mission_metadata.py
test_mission_vessel_arrays.py
test_mission_vessel_counts.py
test_mission_vessel_inventory_integrity.py
test_campaign_data_events.py
test_mission_events import test_mission_events.py
test_campaign_mission_types.py
test_campaign_data_mission_integrity.py
test_mission_language_files.py
test_campaign_mission_index.py
test_campaign_data_mission_types.py
test_campaign_data_special_mission_types.py
test_campaign_data_airbase_aircraft_types.py
test_campaign_data_sosus_lines.py
test_campaign_rpg_mode.py
test_campaign_data_locations.py
test_waypoint_network_integrity.py
test_locations_language_info.py
Functions:
main()
"""
import os
from campaigns_parser import campaign_parser
from report import Report
from write_reports import write_report
# ----------------Test Modules Here----------------------------
from test_campaign_data import test_campaign_data
from test_award_event_files import test_award_event_files
from test_campaign_data_mission_metadata import test_campaign_data_mission_metadata
from test_mission_vessel_arrays import test_mission_vessel_arrays
from test_mission_vessel_counts import test_mission_vessel_counts
from test_mission_vessel_inventory_integrity import (
test_mission_vessel_inventory_integrity,
)
from test_campaign_data_events import test_campaign_data_events
from test_mission_events import test_mission_events
from test_campaign_mission_types import test_campaign_mission_types
from test_campaign_data_mission_integrity import test_campaign_data_mission_integrity
from test_mission_language_files import test_mission_language_files
from test_campaign_mission_index import test_campaign_mission_index
from test_campaign_data_mission_types import test_campaign_data_mission_types
from test_campaign_data_special_mission_types import (
test_campaign_data_special_mission_types,
)
from test_campaign_data_airbase_aircraft_types import (
test_campaign_data_airbase_aircraft_types,
)
from test_campaign_data_sosus_lines import test_campaign_data_sosus_lines
from test_campaign_rpg_mode import test_campaign_rpg_mode
from test_campaign_data_locations import test_campaign_data_locations
from test_waypoint_network_integrity import test_waypoint_network_integrity
from test_locations_language_info import test_locations_language_info
# ----------------End Test Modules-----------------------------
# Current plan: This file will simply be an if name == main: main() block
# main() will first parse a specified whole campaign with the campaign_parser
# then it will run each check and collect the report data
# and then write the report to a file
def main():
"""Take a campaign number, parse campaign data, and run a series of tests on the parsed data
Parameters:
None
Returns:
None
"""
campaign_number = int(input("Select campaign number to check: "))
current_language = input("Input two character language code: ")
campaign_directory = f"{os.getcwd()}" + f"\\campaign\\campaign{campaign_number:03}"
all_reports: list[Report] = []
current_campaign = campaign_parser(campaign_directory, current_language)
all_reports.append(test_campaign_data(current_campaign))
all_reports.append(test_award_event_files(current_campaign))
all_reports.append(test_campaign_data_mission_metadata(current_campaign))
all_reports.append(test_campaign_data_mission_integrity(current_campaign))
all_reports.append(test_campaign_mission_types(current_campaign))
all_reports.append(test_campaign_mission_index(current_campaign))
all_reports.append(test_campaign_data_events(current_campaign))
all_reports.append(test_mission_vessel_arrays(current_campaign))
all_reports.append(test_mission_vessel_counts(current_campaign))
all_reports.append(test_mission_vessel_inventory_integrity(current_campaign))
all_reports.append(test_mission_events(current_campaign))
all_reports.append(test_mission_language_files(current_campaign))
all_reports.append(test_campaign_data_mission_types(current_campaign))
all_reports.append(test_campaign_data_special_mission_types(current_campaign))
all_reports.append(test_campaign_data_airbase_aircraft_types(current_campaign))
all_reports.append(test_campaign_data_sosus_lines(current_campaign))
all_reports.append(test_campaign_rpg_mode(current_campaign))
all_reports.append(test_campaign_data_locations(current_campaign))
all_reports.append(test_waypoint_network_integrity(current_campaign))
all_reports.append(test_locations_language_info(current_campaign))
write_report(all_reports)
print("Program completed.")
if __name__ == "__main__":
main()