Skip to content

Commit 40b102d

Browse files
committed
Fix the test code.
Previous commit add an extra argunment to the "pre_generation" function which I forgot to update the test code. It's all green now.
1 parent 0746878 commit 40b102d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

about_code_tool/genabout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,4 +621,4 @@ def main(args, opts):
621621
option_usage()
622622
sys.exit(errno.EINVAL)
623623

624-
main(args, opts)
624+
main(args, opts)

about_code_tool/tests/test_genabout.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_pre_generation_about_exists_action_0(self):
8080
input_list = [[{'about_file': 'about.py.ABOUT', 'version': '0.8.1',
8181
'about_resource': '.', 'name': 'ABOUT tool'}]]
8282
expected_output_list = []
83-
output_list = gen.pre_generation(gen_location, input_list, action_num, False)
83+
output_list, lic_output_list = gen.pre_generation(gen_location, input_list, action_num, False, False)
8484
self.assertTrue(expected_output_list == output_list, "This output_list should be empty.")
8585
self.assertTrue(len(gen.warnings) == 1, "Should return 1 warnings.")
8686
self.assertFalse(gen.errors, "No errors should be returned.")
@@ -93,7 +93,7 @@ def test_pre_generation_about_exists_action_1(self):
9393
expected_output_list = [[join(TESTDATA_PATH, 'test_files_for_genabout/about.py.ABOUT'),
9494
{'about_file': 'about.py.ABOUT', 'version': '0.8.2',
9595
'about_resource': '.', 'name': 'ABOUT tool'}]]
96-
output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False)
96+
output_list, lic_output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False, False)
9797
self.assertTrue(expected_output_list == output_list)
9898
self.assertFalse(gen.warnings, "No warnings should be returned.")
9999
self.assertFalse(gen.errors, "No errors should be returned.")
@@ -107,7 +107,7 @@ def test_pre_generation_about_exists_action_2(self):
107107
{'test': 'test sample', 'about_file': 'about.py.ABOUT',
108108
'version': '0.8.1', 'about_resource': '.',
109109
'name': 'ABOUT tool'}]]
110-
output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False)
110+
output_list, lic_output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False, False)
111111
self.assertTrue(expected_output_list == output_list)
112112
self.assertFalse(gen.warnings, "No warnings should be returned.")
113113
self.assertFalse(gen.errors, "No errors should be returned.")
@@ -120,7 +120,7 @@ def test_pre_generation_about_exists_action_3(self):
120120
expected_output_list = [[join(TESTDATA_PATH, 'test_files_for_genabout/about.py.ABOUT'),
121121
{'about_file': 'about.py.ABOUT', 'version': '0.8.2',
122122
'about_resource': '.', 'name': '', 'test': 'test sample'}]]
123-
output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False)
123+
output_list, lic_output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, False, False)
124124
self.assertTrue(expected_output_list == output_list)
125125
self.assertFalse(gen.warnings, "No warnings should be returned.")
126126
self.assertFalse(gen.errors, "No errors should be returned.")
@@ -133,7 +133,7 @@ def test_pre_generation_all_in_one(self):
133133
'about_resource': 'elasticsearch-0.19.8.zip',
134134
'name': 'ElasticSearch'}]]
135135
expected_output_list = []
136-
output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, True)
136+
output_list, lic_output_list = gen.pre_generation(GEN_LOCATION, input_list, action_num, True, False)
137137
self.assertFalse(os.path.exists('testdata/test_files_for_genabout/test_generation'),
138138
"This directory shouldn't be generaetd as the all_in_one is set to True.")
139139
self.assertTrue(expected_output_list == output_list, "This output_list should be empty.")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Resource,file_name,Component,Confirmed Version
1+
Directory/Filename,file_name,Component,Confirmed Version
22
about.py.ABOUT,about.py,ABOUT tool,0.8.1

0 commit comments

Comments
 (0)