Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update document.py #1864

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add test case
vvmruder committed Nov 27, 2023
commit 567c77cc19f9142bdff494cf285c1dd4de0f42b3
3 changes: 3 additions & 0 deletions tests/core/sources/test_document_oereblex.py
vvmruder marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -297,6 +297,9 @@ def test_read_related_notice_as_main(oereblex_test_config):
assert isinstance(document.responsible_office, OfficeRecord)
assert document.responsible_office.name == {'de': '-'}
assert document.responsible_office.office_at_web is None
assert source.records[0].responsible_office.office_at_web == {
'de': "http%3A%2F%2Fwww.zihlschlacht-sitterdorf.ch"
}
assert document.published_from == datetime.date(1970, 1, 1)
assert document.index == 40


Unchanged files with check annotations Beta

raise AssertionError('Missing authority for document #{0}'.format(document.id))
if oereblex_doctype is None:
raise AssertionError('Missing type for document #{0}'.format(document.id))
if document.authority_url is None:
authority_url = None

Check warning on line 203 in pyramid_oereb/contrib/data_sources/oereblex/sources/document.py

Codecov / codecov/patch

pyramid_oereb/contrib/data_sources/oereblex/sources/document.py#L202-L203

Added lines #L202 - L203 were not covered by tests
else:
authority_url = {language: document.authority_url}

Check warning on line 205 in pyramid_oereb/contrib/data_sources/oereblex/sources/document.py

Codecov / codecov/patch

pyramid_oereb/contrib/data_sources/oereblex/sources/document.py#L205

Added line #L205 was not covered by tests
# Get document type
document_type = Config.get_document_type_by_data_code(self._code, oereblex_doctype)
# Create related office record
office = OfficeRecord({language: authority}, office_at_web=authority_url)

Check warning on line 211 in pyramid_oereb/contrib/data_sources/oereblex/sources/document.py

Codecov / codecov/patch

pyramid_oereb/contrib/data_sources/oereblex/sources/document.py#L211

Added line #L211 was not covered by tests
# Get files
records = []