Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Add is_iati_xml() errors to error log #92

Merged
merged 96 commits into from
Aug 18, 2017

Conversation

hayfield
Copy link
Contributor

@hayfield hayfield commented Aug 8, 2017

Provide detailed output about whether a Dataset contains valid IATI XML.

dalepotter and others added 30 commits July 19, 2017 12:54
Creating ActivitySchema and OrganisationSchema classes (both children
of iati.core.schema.Schema) means that we can better take account
of differences between the activity and organisation schemas.

This commit also modifies some implementation and test code. However,
not all test code is modified, particularily where there is ambiguity
about if an activity or organisation schema is being used.
This change removes the hard-coding of the resources/standard/.../schema
folder in the implemention of the iati.core.schemas.Schema class. Through
this, the code will be easier to test, as it will be easier to create mock
schema files to be used to create Schema objects.
This fixes python2 tests, due to differences in the way that
python2 and python3 deal with value hashing.
We have decided against the ability to create an iati.core.schema.Schema
by an XML string, due to fact that XSD includes must be flattened within
the schema. Inputted XML may contain relative file paths, which cannot be
easily resolved.
This amends code to instantiate an iati.core.ActivitySchema or
iati.core.OrganisationSchema (as appropriate to the type of
schema. Some refactoring needed to remove duplicate code.
Renaming functions for consistency with other functions.
Relevant linting error not fixed is the apparent false-positive of:
Invalid function name "get_all_organisation_schema_paths" (invalid-name)
The updated name ensures tests are run on both the default organisation
and activity schemas.
Modify docstring indentation to be consistent with elsewhere.
iati.core.schema.Schema is designed to act as a base class for
ActivitySchema and OrganisationSchema.
Adds functions for returning default activity_schemas and
organisation_schemas, plus adds a source_path attribute to the
Schema base class.
hayfield and others added 19 commits August 17, 2017 12:10
Make tests/utilities.py easier to read
This is a tider method of using the strings. It is also more scalable
since there are not valid strings that are prefixes of others - by
searching for the surrounding strings.
Add a load_as_dataset function to test utils
The SSOT contains a number of datasets that are invalid against the
schema. These raise a number of specific types of error. The errors
that they raise have been added as specific types.
This can occur when checking an org file against an activity schema or
vice versa.
The error appears to relate to the addition of an attribute in
a custom namespace.
This is useful for datasets that have been saved on Windows, so
have a UTF-16, ASCII or windows-1252 encoding.
@hayfield hayfield added complete A PR that is in a state that is ready for review. and removed incomplete A PR that is in a state that is not ready for review. labels Aug 18, 2017
@hayfield hayfield requested a review from a team August 18, 2017 11:03
@hayfield
Copy link
Contributor Author

All of the errors present in live data when compared against the 2.02 Activity Schema are now detected.

@hayfield
Copy link
Contributor Author

Fixes #42 somewhere along the lines

@hayfield hayfield merged commit 79397be into validation-info Aug 18, 2017
@hayfield
Copy link
Contributor Author

Merging since will be reviewed later and is based on something else that was OK

@hayfield hayfield deleted the error-log-iati-schema-errors branch August 18, 2017 12:54
@hayfield hayfield added the validation Changes to validation functionality. label Sep 20, 2017
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. validation Changes to validation functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants