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

add support for oereblex api version 1.2.3 #247

Merged
merged 3 commits into from
Apr 21, 2023
Merged

Conversation

michmuel
Copy link
Contributor

  • schema file added for version 1.2.3 (same file as for version 1.2.2)
  • tests added for version 1.2.3 (same tests as for version 1.2.2)

@michmuel michmuel self-assigned this Apr 21, 2023
@michmuel michmuel marked this pull request as draft April 21, 2023 07:52
@michmuel michmuel changed the title draft: add support for oereblex api version 1.2.3 add support for oereblex api version 1.2.3 Apr 21, 2023
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #247 (ee93176) into master (9ff05a2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #247   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files           4        4           
  Lines         274      276    +2     
=======================================
+ Hits          273      275    +2     
  Misses          1        1           

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylint (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 6
assert documents[0].index is None
assert documents[-3].index == 1

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
assert documents[0].index is None
assert documents[-3].index == 1
assert documents[-2].index == 2
assert documents[-1].index == 3

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
with open('tests/resources/geolink_v1.2.3.xml', 'rb') as f:
m.get('http://oereblex.test.com/api/geolinks/1500.xml', content=f.read())
documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 5

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
m.get('http://oereblex.test.com/api/geolinks/1500.xml', content=f.read())
documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 5
assert documents[0].index is None

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 5
assert documents[0].index is None
assert documents[-3].index == 1

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
assert len(documents) == 6
assert documents[0].index is None
assert documents[-3].index == 1
assert documents[-2].index == 2

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
assert len(documents) == 5
assert documents[0].index is None
assert documents[-3].index == 1
assert documents[-2].index == 2

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
m.get('http://oereblex.test.com/api/geolinks/1500.xml', content=f.read())
documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 6
assert documents[0].index is None

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
assert documents[0].index is None
assert documents[-3].index == 1
assert documents[-2].index == 2
assert documents[-1].index == 3

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
with open('tests/resources/prepublink_v1.2.3.xml', 'rb') as f:
m.get('http://oereblex.test.com/api/geolinks/1500.xml', content=f.read())
documents = XML(version=SCHEMA.V1_2_2).from_url('http://oereblex.test.com/api/geolinks/1500.xml')
assert len(documents) == 6

Check warning

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylintpython3 (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@kdeininger kdeininger added this to the v2.0.4 milestone Apr 21, 2023
@kdeininger kdeininger added the enhancement New feature or request label Apr 21, 2023
@jwkaltz
Copy link
Member

jwkaltz commented Apr 21, 2023

  • schema file added for version 1.2.3 (same file as for version 1.2.2)
  • tests added for version 1.2.3 (same tests as for version 1.2.2)

Do you know what exactly changes between 1.2.2 and 1.2.3? Do you see an impact on pyramid_oereb?

@michmuel
Copy link
Contributor Author

@jwkaltz From the release notes (see below) I do not expect any effects on pyramid oereb. Do you?

Release Notes:
OEREBlex:

  1. GeoLink XML (Version 1.2.3): Municipality Tag wurde bislang nur ausgewiesen, wenn der Entscheid auf der Gemeinde-Ebene erfasst wurde. Neu wird dieser auch ausgegeben, wenn die Subtypen die Gemeinden sind.
  2. GeoLink HTML (Version 1.2.3): Datum Ausserkraft wird auch ausgewiesen (bislang nur im XML vorhanden).
  3. Vereinheitlichung von Links zu Dokumenten, damit alle in einem neuen Tab geöffnet werden.
    Zusatzmodul Vorwirkungen:
  4. Neuer Export "Vorwirkungen" im Register "Exporte" inkl. XML-Abfrage /api/public_prepublications.xml, analog zu /api/public_decrees.xml. Beide enthalten nur Vorwirkungen welche noch nicht zu einem Entscheid konvertiert wurden.
  5. Suche wird erweitert um Prepub-Link ID.
  6. Der Knopf "Zu Entscheid konvertieren" bei den Vorwirkungen ist nicht mehr aktiv wenn eine Version dieser Vorwirkung bereits zum Entscheid konvertiert wurde.
    Zusatzmodul Frontend:
  7. Neue Filtermöglichkeit mit Checkbox "Nur in Kraft stehende Erlasse anzeigen" und "Nur in Kraft stehende Entscheide anzeigen".
    Bug-Fixes:
  8. Das unkontrollierte Springen nach oben wurde in der Baumansicht (links) behoben.
  9. Bei der Funktion Entscheid kopieren wird nicht mehr der Filter auf "alle" gewechselt.

@michmuel
Copy link
Contributor Author

I will merge the branch and create a new tag. Then, we will perform tests with pyramid oereb and the preview instance of oereblex for our cantonal setting.

@michmuel michmuel marked this pull request as ready for review April 21, 2023 11:23
@michmuel michmuel added this pull request to the merge queue Apr 21, 2023
Merged via the queue into master with commit 7880253 Apr 21, 2023
@michmuel michmuel deleted the api-version-1.2.3 branch April 21, 2023 11:24
@jwkaltz
Copy link
Member

jwkaltz commented Apr 21, 2023

@michmuel thanks, I also don't see a direct impact on pyramid_oereb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants