This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Check is_iati_xml()
during full_validation()
#239
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, the checks for Rulesets being in full validation were checked at the Ruleset-conformance level rather than the full_validation level. This new organisation better groups associated tests.
Checking that something is valid XML is performed before the Codelist checks. As such, it makes some amount of sense that the tests are in this order.
This step was missing. To add it in, an error needs raising and handling for when a non-Dataset is provided.
hayfield
added
tests
Relating to tests and testing.
validation
Changes to validation functionality.
labels
Nov 15, 2017
Updates docs for #239
allthatilk
previously requested changes
Nov 16, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a lil' change =)
iati/validator.py
Outdated
@@ -445,6 +446,8 @@ def _check_is_iati_xml(dataset, schema): | |||
for log_entry in doc_invalid.error_log: # pylint: disable=no-member | |||
error = _create_error_for_lxml_log_entry(log_entry) | |||
error_log.add(error) | |||
except AttributeError: | |||
raise TypeError('The provided argument that should have been a Dataset was actually a {0}'.format(type(dataset))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to word:
('Unexpected argument: {0} is not an iati.data.Dataset'.format(type(dataset)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per suggestion in review of #239
allthatilk
approved these changes
Nov 16, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
complete
A PR that is in a state that is ready for review.
tests
Relating to tests and testing.
validation
Changes to validation functionality.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of full validation, it should be checked that data is IATI XML. This PR adds this.
Certain tests have been refactored so that
full_validation()
is tested within theTestValidatorFullValidation
class rather than in other areas.Fixes #238