Skip to content

Commit 0e89738

Browse files
committed
Update test code for the latest changes.
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent d906305 commit 0e89738

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/test_gen.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ def test_load_inventory(self):
6161
errors, abouts = gen.load_inventory(mapping, location, base_dir)
6262

6363
file_path = posixpath.normpath(posixpath.join(base_dir, '.'))
64-
err_msg = u'Field about_resource: Path %s not found' % file_path
6564

6665
expected_errors = [
67-
Error(INFO, u'Field custom1 is not a supported field and is ignored.'),
68-
Error(CRITICAL, err_msg)]
66+
Error(INFO, u'Field custom1 is not a supported field and is ignored.')]
6967
assert expected_errors == errors
7068

7169
expected = [u'about_resource: .\n'
@@ -136,6 +134,7 @@ def test_generate(self):
136134
for a in abouts][0]
137135
expected = (u'about_resource: .\n'
138136
u'name: AboutCode\n'
137+
u'about_resource_path: .\n'
139138
u'version: 0.11.0\n'
140139
u'description: |\n'
141140
u' multi\n'

tests/test_model.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def test_About_with_existing_about_resource_has_no_error(self):
398398
test_file = get_test_loc('parser_tests/about_resource_field.ABOUT')
399399
a = model.About(test_file)
400400
assert [] == a.errors
401-
result = a.about_resource.value['about_resource.c']
401+
result = a.about_resource_path.value['./about_resource.c']
402402
# this means we have a location
403403
self.assertNotEqual([], result)
404404

@@ -415,7 +415,7 @@ def test_About_has_errors_when_about_resource_does_not_exist(self):
415415
test_file = get_test_loc('parser_tests/missing_about_ref.ABOUT')
416416
file_path = posixpath.join(posixpath.dirname(test_file), 'about_file_missing.c')
417417
a = model.About(test_file)
418-
err_msg = u'Field about_resource: Path %s not found' % file_path
418+
err_msg = u'Field about_resource_path: Path %s not found' % file_path
419419
expected = [
420420
Error(CRITICAL, err_msg)]
421421
result = a.errors
@@ -955,7 +955,7 @@ def test_load_can_load_unicode(self):
955955
a = model.About()
956956
a.load(test_file)
957957
file_path = posixpath.join(posixpath.dirname(test_file), 'nose-selecttests-0.3.zip')
958-
err_msg = u'Field about_resource: Path %s not found' % file_path
958+
err_msg = u'Field about_resource_path: Path %s not found' % file_path
959959
errors = [
960960
Error(INFO, u'Field dje_license is not a supported field and is ignored.'),
961961
Error(INFO, u'Field license_text_file is not a supported field and is ignored.'),
@@ -1004,6 +1004,7 @@ def test_as_dict_load_dict_is_idempotent(self):
10041004
def test_load_dict_handles_field_validation_correctly(self):
10051005
self.maxDiff = None
10061006
test = {u'about_resource': u'.',
1007+
u'about_resource_path': u'.',
10071008
u'attribute': u'yes',
10081009
u'author': u'Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez',
10091010
u'copyright': u'Copyright (c) 2013-2014 nexB Inc.',
@@ -1101,8 +1102,8 @@ def test_collect_inventory_return_errors(self):
11011102
file_path1 = posixpath.join(test_loc, 'distribute_setup.py')
11021103
file_path2 = posixpath.join(test_loc, 'date_test.py')
11031104

1104-
err_msg1 = u'non-supported_date_format.ABOUT: Field about_resource: Path %s not found' % file_path1
1105-
err_msg2 = u'supported_date_format.ABOUT: Field about_resource: Path %s not found' % file_path2
1105+
err_msg1 = u'non-supported_date_format.ABOUT: Field about_resource_path: Path %s not found' % file_path1
1106+
err_msg2 = u'supported_date_format.ABOUT: Field about_resource_path: Path %s not found' % file_path2
11061107
expected_errors = [
11071108
Error(INFO, u'non-supported_date_format.ABOUT: Field date is not a supported field and is ignored.'),
11081109
Error(INFO, u'supported_date_format.ABOUT: Field date is not a supported field and is ignored.'),

0 commit comments

Comments
 (0)