Skip to content

Commit

Permalink
Merge pull request #115 from vysakh-menon-aot/feature/14097
Browse files Browse the repository at this point in the history
14097 update address schema to be consistent
  • Loading branch information
vysakh-menon-aot authored Nov 7, 2022
2 parents 35a99ea + fbb47e1 commit 54bd868
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/registry_schemas/schemas/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"maxLength": 50
},
"streetAddressAdditional": {
"type": "string",
"type": [
"string",
"null"
],
"maxLength": 50
},
"addressCity": {
Expand Down Expand Up @@ -43,7 +46,6 @@
"streetAddress",
"addressCity",
"addressCountry",
"postalCode",
"addressRegion"
"postalCode"
]
}
2 changes: 1 addition & 1 deletion src/registry_schemas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '2.15.36' # pylint: disable=invalid-name
__version__ = '2.15.37' # pylint: disable=invalid-name
12 changes: 10 additions & 2 deletions tests/unit/test_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"""
import copy

import pytest

from registry_schemas import validate
from registry_schemas.example_data import ADDRESS

Expand Down Expand Up @@ -63,10 +65,16 @@ def test_invalid_address():
assert not is_valid


def test_invalid_address_missing_region():
@pytest.mark.parametrize('field', [
'streetAddress',
'addressCity',
'addressCountry',
'postalCode'
])
def test_invalid_address_missing_field(field):
"""Assert that an invalid address fails - missing required field addressRegion."""
address = copy.deepcopy(ADDRESS)
del address['addressRegion']
del address[field]

is_valid, errors = validate(address, 'address')

Expand Down

0 comments on commit 54bd868

Please sign in to comment.