Skip to content

Commit 26a131d

Browse files
authored
Merge pull request #6 from prosegrinder/constants
Added Constants
2 parents dfbee11 + a63f25a commit 26a131d

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
dist: xenial
12
language: python
23
python:
3-
- pypy3
4-
- pypy
4+
- 'pypy3.5'
5+
- '3.7'
56
- '3.6'
67
- '3.5'
78
- '3.4'
@@ -10,15 +11,16 @@ sudo: false
1011
install:
1112
- pip install -U pip
1213
- pip install -U pytest
13-
script:
14+
- pip install -U twine
1415
- python ./setup.py develop
15-
- pytest tests/*
16+
script:
17+
- pytest ./tests/
1618
deploy:
1719
provider: pypi
1820
user: davidlday
1921
password:
2022
secure: Sqbs5JjSDlgfhfDjqBUQibtFkonfOr7WOIXRcGywclcb/BoblK2i6y5TMZE4Le0aMwtmWZ72CruIJu31H010HzVi2LuH+l6MiDdkDJW5J54ctnCXi9jysvp2iHt7EXsFMG5tMwbc0fQtnPGskaBq7WFt/NMkPyFfodIJa/OAWaMDPCLXaultDzcLCGCVD9EAJCz49cEJeYCGPBY5bCwwsq95OmM/71snJNoWwIhsl8x9wydsTEqESNokrSXzk52+YJ1eWmIP8dFn7mcHroveAEaV7raHprNDTskBLvkfDYiaqvjOb+VHYk/HxHvJOAqDdBvJSzhA18PjmFkfdxveV/BehbvGzBCrQU4hNNP9HdPFyx0wU2xkPeEC6BlSqzYpx/esvAcFJYFEeGZlX8ciDIaCYynRe40EbeQQgI4QSiisMsZ0PyBzOCJ271yoxzrqYlTrlsEkTfp9o1x9HX6hQwRPjMoIVnBHB8jKginkPjXLuxythOQ14/1+D11He6HHrFiYVQ2TSJwA/bOuuJVolrXWwwM52LB7JjoF9jr79V+/804ZzfWehVBChmaDl+hZLxqcJ7LExHhvCKB08p8yRZeWdtttBsxQMCa+7NAVwiZSOTSg4jnqlMKLR9be3eblGkeQkWFNOpbA1LP89amIixhi91zBY7bEP6HOXlMR2gg=
2123
distributions: sdist bdist_wheel
2224
on:
23-
python: '3.6'
25+
python: '3.7'
2426
tags: true

pointofview/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.3.0

pointofview/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
__version__ = pkg_resources.resource_string(
1111
'pointofview', 'VERSION').decode('utf-8').strip()
1212

13+
# Constants for use in comparisons
14+
FIRST = 'first'
15+
SECOND = 'second'
16+
THIRD = 'third'
17+
NONE = None
18+
1319
# NOTE:
1420
# Words are expected to be in lower case.
1521
#
@@ -18,13 +24,13 @@
1824
# Second person PoV can also contain third person words.
1925
# Third person PoV can only contain third person words.
2026
POV_WORDS = OrderedDict([
21-
('first',
27+
(FIRST,
2228
["i", "i'm", "i'll", "i'd", "i've", "me", "mine", "myself", "we",
2329
"we're", "we'll", "we'd", "we've", "us", "ours", "ourselves"]),
24-
('second',
30+
(SECOND,
2531
["you", "you're", "you'll", "you'd", "you've",
2632
"your", "yours", "yourself", "yourselves"]),
27-
('third',
33+
(THIRD,
2834
["he", "he's", "he'll", "he'd", "him", "his", "himself", "she", "she's",
2935
"she'll", "she'd", "her", "hers", "herself", "it", "it's", "it'll",
3036
"it'd", "itself", "they", "they're", "they'll", "they'd", "they've",

tests/test_pointofview.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
# https://docs.pytest.org/en/latest/index.html
3333

3434
def test_first():
35-
assert(pointofview.get_text_pov(POV_FIRST_SINGULAR) == 'first') # nosec
36-
assert(pointofview.get_text_pov(POV_FIRST_PLURAL) == 'first') # nosec
35+
assert(pointofview.get_text_pov(POV_FIRST_SINGULAR) == pointofview.FIRST) # nosec
36+
assert(pointofview.get_text_pov(POV_FIRST_PLURAL) == pointofview.FIRST) # nosec
3737

3838
def test_second():
39-
assert(pointofview.get_text_pov(POV_SECOND) == 'second') # nosec
39+
assert(pointofview.get_text_pov(POV_SECOND) == pointofview.SECOND) # nosec
4040

4141
def test_third():
42-
assert(pointofview.get_text_pov(POV_THIRD) == 'third') # nosec
42+
assert(pointofview.get_text_pov(POV_THIRD) == pointofview.THIRD) # nosec
4343

4444
def test_none():
45-
assert(pointofview.get_text_pov(POV_NONE) == None) # nosec
45+
assert(pointofview.get_text_pov(POV_NONE) == pointofview.NONE) # nosec

0 commit comments

Comments
 (0)