Skip to content

Commit

Permalink
Merge pull request #2 from simonhayward/master
Browse files Browse the repository at this point in the history
Updating to validate N1P district
  • Loading branch information
hamstah committed Jan 30, 2015
2 parents 621a9b0 + 11d24c4 commit 5bf544d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ukpostcodeparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
'WS', 'WV', 'YO', 'ZE']
POSTAL_ZONES_ONE_CHAR = [zone for zone in POSTAL_ZONES if len(zone) == 1]
POSTAL_ZONES_TWO_CHARS = [zone for zone in POSTAL_ZONES if len(zone) == 2]
THIRD_POS_CHARS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'S',
'T', 'U', 'W']
THIRD_POS_CHARS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'P',
'S', 'T', 'U', 'W']
FOURTH_POS_CHARS = ['A', 'B', 'E', 'H', 'M', 'N', 'P', 'R', 'V', 'W', 'X',
'Y']
INCODE_CHARS = ['A', 'B', 'D', 'E', 'F', 'G', 'H', 'J', 'L', 'N', 'P', 'Q',
Expand Down
5 changes: 5 additions & 0 deletions ukpostcodeparser/test/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@
('w1m 4zz', True, True, 'ValueError'),
('w1m', True, True, 'ValueError'),
('dn169aaA', True, True, 'ValueError'),
('N1P 2ZX', True, False, ('N1P', '2ZX')),
('n1p', True, False, ('N1P', '')),
('n1p1gw', True, True, ('N1P', '1GW')),
('NPT 0DT', True, True, 'ValueError'),
('npt', True, False, 'ValueError'),
]


Expand Down

0 comments on commit 5bf544d

Please sign in to comment.