Skip to content

Commit

Permalink
v1.0.1, document surnames attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
derek73 committed Sep 1, 2018
1 parent 9a3d187 commit 438bc7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/usage.rst
Expand Up @@ -23,6 +23,8 @@ The examples use Python 3, but Python 2.6+ is supported.
'de la Vega'
>>> name.suffix
'III'
>>> name.surnames
'Q. Xavier de la Vega'
>>> name.full_name = "Juan Q. Xavier Velasquez y Garcia, Jr."
>>> name
<HumanName : [
Expand Down
2 changes: 1 addition & 1 deletion nameparser/__init__.py
@@ -1,4 +1,4 @@
VERSION = (1, 0, 0)
VERSION = (1, 0, 1)
__version__ = '.'.join(map(str, VERSION))
__author__ = "Derek Gulbranson"
__author_email__ = 'derek73@gmail.com'
Expand Down
6 changes: 6 additions & 0 deletions tests.py
Expand Up @@ -1260,15 +1260,21 @@ class ConstantsCustomization(HumanNameTestBase):

def test_add_title(self):
hn = HumanName("Te Awanui-a-Rangi Black", constants=None)
start_len = len(hn.C.titles)
self.assert_(start_len > 0)
hn.C.titles.add('te')
self.assertEqual(start_len + 1, len(hn.C.titles))
hn.parse_full_name()
self.m(hn.title, "Te", hn)
self.m(hn.first, "Awanui-a-Rangi", hn)
self.m(hn.last, "Black", hn)

def test_remove_title(self):
hn = HumanName("Hon Solo", constants=None)
start_len = len(hn.C.titles)
self.assert_(start_len > 0)
hn.C.titles.remove('hon')
self.assertEqual(start_len - 1, len(hn.C.titles))
hn.parse_full_name()
self.m(hn.first, "Hon", hn)
self.m(hn.last, "Solo", hn)
Expand Down

0 comments on commit 438bc7d

Please sign in to comment.