-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.py
More file actions
34 lines (26 loc) · 764 Bytes
/
Test.py
File metadata and controls
34 lines (26 loc) · 764 Bytes
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
import Core
# TODO Create Documentation
instances = []
test_phrase = "This is a test"
mutation_rate = 1
population_number = 500
def create_instances(total_number):
try:
for i in range(0, total_number):
instances.append(Core.engine(test_phrase, mutation_rate, population_number))
print("Build finished")
except Exception as ext:
print("Build failed: " + str(ext))
exit()
def test_attributes():
if(
instances[0].target == test_phrase and
instances[0].mutationRate == mutation_rate and
instances[0].popmax == population_number
):
print("testAttributes finished")
else:
print("testAttributes failed")
exit()
create_instances(10)
test_attributes()