-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundesanzeiger: black-format code and add path resolution to link test
This resolves the path to response.html in test_get_next_page_link relative to __file__ (which should be the local path to the python test file). This should hopefully work on the CI server. I also ran black ./src and black ./tests
- Loading branch information
Showing
2 changed files
with
8 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import os | ||
from deutschland.bundesanzeiger import Bundesanzeiger | ||
|
||
|
||
def test_get_next_page_link(): | ||
with open('response.html') as file: | ||
ba = Bundesanzeiger() | ||
html_file = os.path.join(os.path.dirname(__file__), "response.html") | ||
with open(html_file) as file: | ||
html = file.read() | ||
link = ba._Bundesanzeiger__get_next_page_link(html) | ||
assert link == 'https://www.bundesanzeiger.de/pub/de/suchen2?4-1.-top~nav-pager-navigation-1-pagination~link' | ||
ba = Bundesanzeiger() | ||
link = ba._Bundesanzeiger__get_next_page_link(html) | ||
expected = "https://www.bundesanzeiger.de/pub/de/suchen2?4-1.-top~nav-pager-navigation-1-pagination~link" | ||
assert link == expected |