Skip to content

Commit cce1580

Browse files
committed
Correct error message
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 54ec2e7 commit cce1580

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/attributecode/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ def validate_fields(fields, about_file_path, running_inventory, base_dir,
718718

719719
def validate_field_name(name):
720720
if not is_valid_name(name):
721-
msg = ('Field name: %(name)r contains illegal name characters: '
722-
'0 to 9, a to z, A to Z and _. (or empty spaces) and is ignored.')
721+
msg = ('Field name: %(name)r contains illegal name characters '
722+
'(or empty spaces) and is ignored.')
723723
return Error(CRITICAL, msg % locals())
724724

725725

@@ -952,8 +952,8 @@ def hydrate(self, fields):
952952
errors.append(Error(CRITICAL, msg % locals()))
953953

954954
if illegal_name_list:
955-
msg = ('Field name: %(illegal_name_list)r contains illegal name characters: '
956-
'0 to 9, a to z, A to Z and _. (or empty spaces) and is ignored.')
955+
msg = ('Field name: %(illegal_name_list)r contains illegal name characters '
956+
'(or empty spaces) and is ignored.')
957957
errors.append(Error(CRITICAL, msg % locals()))
958958
return errors
959959

tests/test_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_load_inventory_with_errors(self):
103103
base_dir = get_temp_dir()
104104
errors, abouts = gen.load_inventory(location, base_dir=base_dir)
105105
expected_errors = [
106-
Error(CRITICAL, "Field name: ['confirmed copyright'] contains illegal name characters: 0 to 9, a to z, A to Z and _. (or empty spaces) and is ignored."),
106+
Error(CRITICAL, "Field name: ['confirmed copyright'] contains illegal name characters (or empty spaces) and is ignored."),
107107
Error(INFO, 'Field about_resource: Path'),
108108
Error(INFO, "Field ['resource', 'test'] is a custom field.")
109109
]

tests/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def test_About_rejects_non_ascii_names_and_accepts_unicode_values(self):
582582
test_file = get_test_loc('test_model/parse/non_ascii_field_name_value.about')
583583
a = model.About(test_file)
584584
expected = [
585-
Error(CRITICAL, "Field name: ['mat\xedas'] contains illegal name characters: 0 to 9, a to z, A to Z and _. (or empty spaces) and is ignored.")
585+
Error(CRITICAL, "Field name: ['mat\xedas'] contains illegal name characters (or empty spaces) and is ignored.")
586586
]
587587
assert expected == a.errors
588588

0 commit comments

Comments
 (0)