Skip to content

Commit

Permalink
Update 3 more Validators with verify_type, remove 'type' in validatio…
Browse files Browse the repository at this point in the history
…n def
  • Loading branch information
amywieliczka committed Dec 1, 2023
1 parent 01dd884 commit 0e03c4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions metadata_mapper/mappers/flickr/sdasm_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@ class SdasmValidator(FlickrValidator):
def __init__(self, **options):
super().__init__(**options)
self.add_validatable_field(
field="identifier", type=Validator.list_of(str),
field="identifier",
validations=[
SdasmValidator.content_match,
Validator.type_match
Validator.verify_type(Validator.list_of(str))
]
)
self.add_validatable_field(
field="type", type=Validator.list_of(str),
field="type",
validations=[
Validator.required_field,
SdasmValidator.type_exception,
Validator.type_match
Validator.verify_type(Validator.list_of(str))
]

)
Expand Down
2 changes: 1 addition & 1 deletion metadata_mapper/mappers/flickr/sppl_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SpplFlickrValidator(FlickrValidator):
def __init__(self, **options):
super().__init__(**options)
self.add_validatable_field(
field="description", type=str,
field="description",
validations=[
SpplFlickrValidator.content_match,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ def map_type(self) -> str:
class UcsdBlacklightValidator(Validator):
def setup(self, **options):
self.add_validatable_field(
field="identifier", type=Validator.list_of(str),
field="identifier",
validations=[
UcsdBlacklightValidator.identifier_content_match,
Validator.type_match
Validator.verify_type(Validator.list_of(str))
]
)

Expand Down

0 comments on commit 0e03c4f

Please sign in to comment.