-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestHarness.py
More file actions
35 lines (32 loc) · 1.15 KB
/
TestHarness.py
File metadata and controls
35 lines (32 loc) · 1.15 KB
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
# ---------------------------------------------------------- #
# Title: TestHarness.py - Assignment09
# Description: A main module for testing
# ChangeLog (Who,When,What):
# RRoot,1.1.2030,Created started script
# ASimpson, 03/21/2020, Modified this script for testing
# ---------------------------------------------------------- #
if __name__ == "__main__":
from DataClasses import Employee as Emp
from ProcessingClasses import FileProcessor as Fp
from IOClasses import EmployeeIO as Eio
else:
raise Exception("This file was not created to be imported")
# Test data module
objP1 = Emp(1, "Bob", "Smith")
objP2 = Emp(2, "Sue", "Jones")
lstTable = [objP1, objP2]
for row in lstTable:
print(row.to_string(), type(row))
# Test processing module
Fp.save_data_to_file("EmployeeData.txt", lstTable)
lstFileData = Fp.read_data_from_file("EmployeeData.txt")
lstTable.clear()
for line in lstFileData:
lstTable.append(Emp(line[0], line[1], line[2].strip()))
for row in lstTable:
print(row.to_string(), type(row))
# Test IO classes
Eio.print_menu_items()
Eio.print_current_list_items(lstTable)
print(Eio.input_employee_data())
print(Eio.input_menu_options())