Skip to content

Commit 17e2f22

Browse files
committed
#349 Update owner from ListField to StringField
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent cab975b commit 17e2f22

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* New UrlListField introduced for list of urls
66
* The UrlField is now only taking single URL value
7+
* The owner is now a StringField instead of ListField
78

89

910
2018-10-23

src/attributecode/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def create_fields(self):
729729

730730
('changelog_file', FileTextField()),
731731

732-
('owner', ListField()),
732+
('owner', StringField()),
733733
('owner_url', UrlField()),
734734
('contact', ListField()),
735735
('author', ListField()),

tests/test_model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,7 @@ def test_About_dumps(self):
724724
key: apache-2.0
725725
name: AboutCode
726726
notice_file: NOTICE
727-
owner:
728-
- nexB Inc.
727+
owner: nexB Inc.
729728
vcs_repository: https://github.com/dejacode/about-code-tool.git
730729
vcs_tool: git
731730
version: 0.11.0
@@ -929,7 +928,7 @@ def test_About_as_dict_with_nothing(self):
929928
'license_key': [u'apache-2.0'],
930929
'license_expression': u'apache-2.0',
931930
'name': u'AboutCode',
932-
'owner': [u'nexB Inc.']}
931+
'owner': u'nexB Inc.'}
933932
result = a.as_dict(with_paths=False,
934933
with_empty=False,
935934
with_absent=False)
@@ -989,7 +988,7 @@ def test_as_dict_load_dict_is_idempotent(self):
989988
'description': u'AboutCode is a tool\nfor files.',
990989
'license_expression': u'apache-2.0',
991990
'name': u'AboutCode',
992-
'owner': [u'nexB Inc.']}
991+
'owner': u'nexB Inc.'}
993992

994993
a = model.About()
995994
base_dir = 'some_dir'
@@ -1007,7 +1006,7 @@ def test_load_dict_handles_field_validation_correctly(self):
10071006
u'homepage_url': u'http://dejacode.org',
10081007
u'license_expression': u'apache-2.0',
10091008
u'name': u'AboutCode',
1010-
u'owner': [u'nexB Inc.'],
1009+
u'owner': u'nexB Inc.',
10111010
u'vcs_repository': u'https://github.com/dejacode/about-code-tool.git',
10121011
u'vcs_tool': u'git',
10131012
u'version': u'0.11.0'}

0 commit comments

Comments
 (0)