update for tests
This commit is contained in:
parent
c03eff2b2a
commit
25d2019506
2 changed files with 5 additions and 8 deletions
|
|
@ -27,7 +27,7 @@ viewpoint/pronouns Subject Object Possessive Possessive Reflexive
|
||||||
"""
|
"""
|
||||||
from evennia.utils.utils import copy_word_case, is_iter
|
from evennia.utils.utils import copy_word_case, is_iter
|
||||||
|
|
||||||
DEFAULT_PRONOUN_TYPE = "object pronoun"
|
DEFAULT_PRONOUN_TYPE = "subject pronoun"
|
||||||
DEFAULT_VIEWPOINT = "2nd person"
|
DEFAULT_VIEWPOINT = "2nd person"
|
||||||
DEFAULT_GENDER = "neutral"
|
DEFAULT_GENDER = "neutral"
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ PRONOUN_MAPPING = {
|
||||||
"male": "his",
|
"male": "his",
|
||||||
"female": "her",
|
"female": "her",
|
||||||
"neutral": "its",
|
"neutral": "its",
|
||||||
"plural": "theirs"
|
"plural": "their"
|
||||||
},
|
},
|
||||||
"possessive pronoun": {
|
"possessive pronoun": {
|
||||||
"male": "his",
|
"male": "his",
|
||||||
|
|
@ -185,7 +185,7 @@ PRONOUN_TABLE = {
|
||||||
),
|
),
|
||||||
"yourself": (
|
"yourself": (
|
||||||
"2nd person",
|
"2nd person",
|
||||||
GENDERS,
|
("neutral", "male", "female"),
|
||||||
"reflexive pronoun"
|
"reflexive pronoun"
|
||||||
),
|
),
|
||||||
"yourselves": (
|
"yourselves": (
|
||||||
|
|
@ -304,7 +304,7 @@ ALIASES = {
|
||||||
|
|
||||||
|
|
||||||
def pronoun_to_viewpoints(
|
def pronoun_to_viewpoints(
|
||||||
pronoun, options=None, pronoun_type="object pronoun", gender="neutral", viewpoint="2nd person"
|
pronoun, options=None, pronoun_type=DEFAULT_PRONOUN_TYPE, gender=DEFAULT_GENDER, viewpoint=DEFAULT_VIEWPOINT
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Access function for determining the forms of a pronount from different viewpoints.
|
Access function for determining the forms of a pronount from different viewpoints.
|
||||||
|
|
@ -404,7 +404,6 @@ def pronoun_to_viewpoints(
|
||||||
pronouns = viewpoint_map[pronoun_type]
|
pronouns = viewpoint_map[pronoun_type]
|
||||||
else:
|
else:
|
||||||
pronouns = viewpoint_map[DEFAULT_PRONOUN_TYPE]
|
pronouns = viewpoint_map[DEFAULT_PRONOUN_TYPE]
|
||||||
|
|
||||||
if gender in pronouns:
|
if gender in pronouns:
|
||||||
mapped_pronoun = pronouns[gender]
|
mapped_pronoun = pronouns[gender]
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ class TestPronounMapping(TestCase):
|
||||||
("you", "m", "you", "he"),
|
("you", "m", "you", "he"),
|
||||||
("you", "f op", "you", "her"),
|
("you", "f op", "you", "her"),
|
||||||
("I", "", "I", "it"),
|
("I", "", "I", "it"),
|
||||||
("I", "p", "I", "it"), # plural is invalid
|
("I", "p", "I", "they"),
|
||||||
("I", "m", "I", "he"),
|
("I", "m", "I", "he"),
|
||||||
("Me", "n", "Me", "It"),
|
("Me", "n", "Me", "It"),
|
||||||
("your", "p", "your", "their"),
|
("your", "p", "your", "their"),
|
||||||
|
|
@ -295,7 +295,6 @@ class TestPronounMapping(TestCase):
|
||||||
("her", "p", "you", "her"),
|
("her", "p", "you", "her"),
|
||||||
("her", "pa", "your", "her"),
|
("her", "pa", "your", "her"),
|
||||||
("their", "pa", "your", "their"),
|
("their", "pa", "your", "their"),
|
||||||
("their", "pa", "your", "their"),
|
|
||||||
("itself", "", "yourself", "itself"),
|
("itself", "", "yourself", "itself"),
|
||||||
("themselves", "", "yourselves", "themselves"),
|
("themselves", "", "yourselves", "themselves"),
|
||||||
("herself", "", "yourself", "herself"),
|
("herself", "", "yourself", "herself"),
|
||||||
|
|
@ -311,6 +310,5 @@ class TestPronounMapping(TestCase):
|
||||||
received_1st_or_2nd_person, received_3rd_person = pronouns.pronoun_to_viewpoints(
|
received_1st_or_2nd_person, received_3rd_person = pronouns.pronoun_to_viewpoints(
|
||||||
pronoun, options
|
pronoun, options
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(expected_1st_or_2nd_person, received_1st_or_2nd_person)
|
self.assertEqual(expected_1st_or_2nd_person, received_1st_or_2nd_person)
|
||||||
self.assertEqual(expected_3rd_person, received_3rd_person)
|
self.assertEqual(expected_3rd_person, received_3rd_person)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue