Skip to content

Commit 173aeb1

Browse files
committed
Reorg tests and remove unused test files and code
* remove unused test files and functions * update or remove failing tests * move test files under their own dir for each test_XXX module * update and correct all expectedFailure Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 091acd9 commit 173aeb1

File tree

249 files changed

+309
-2001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+309
-2001
lines changed

tests/test_gen.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from attributecode import Error
3131
from attributecode import gen
3232
from attributecode import DEFAULT_MAPPING
33+
from unittest.case import skip
3334

3435

3536
class GenTest(unittest.TestCase):
@@ -56,7 +57,7 @@ def test_check_duplicated_about_file_path(self):
5657

5758
def test_load_inventory(self):
5859
location = get_test_loc('test_gen/inv.csv')
59-
base_dir = get_test_loc('inv')
60+
base_dir = get_temp_dir()
6061
errors, abouts = gen.load_inventory(location, base_dir)
6162

6263
expected_errors = [
@@ -81,10 +82,10 @@ def test_load_inventory(self):
8182

8283
def test_load_inventory_with_mapping(self):
8384
location = get_test_loc('test_gen/inv4.csv')
84-
base_dir = get_test_loc('test_gen/inv')
85+
base_dir = get_temp_dir()
8586
errors, abouts = gen.load_inventory(location, base_dir, mapping_file=DEFAULT_MAPPING)
8687

87-
expected_errors =[
88+
expected_errors = [
8889
Error(INFO, 'Field resource is a custom field'),
8990
Error(INFO, 'Field test is not a supported field and is not defined in the mapping file. This field is ignored.'),
9091
Error(INFO, 'Field about_resource: Path ')
@@ -170,16 +171,17 @@ def test_generate(self):
170171
' line\n')
171172
assert expected == in_mem_result
172173

174+
@skip('FIXME: this test is making a failed, live API call')
173175
def test_generate_not_overwrite_original_license_file(self):
174176
location = get_test_loc('test_gen/inv5.csv')
175177
base_dir = get_temp_dir()
176178
license_notice_text_location = None
177179
fetch_license = ['url', 'lic_key']
178180

179-
_errors, abouts = gen.generate(location, base_dir, license_notice_text_location, fetch_license)
181+
_errors, abouts = gen.generate(
182+
location, base_dir, license_notice_text_location, fetch_license)
180183

181-
in_mem_result = [a.dumps(mapping_file=False, with_absent=False, with_empty=False)
182-
for a in abouts][0]
184+
in_mem_result = [a.dumps(with_empty=False)for a in abouts][0]
183185
expected = (
184186
'about_resource: .\n'
185187
'name: AboutCode\n'

0 commit comments

Comments
 (0)