mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-06 10:20:43 +00:00
gitweb: Make functional tests compatible with pytest-bdd v4.0
In pytest-bdd v4.0, given steps are no longer fixtures. - Make gitweb_repo_metadata a fixture. - Remove errorneous fixture usage from the gitweb_repo_should_not_exist step (fixture gitweb_repo returned always None). Tested that gitweb functional tests pass when using pytest v4.0.2 Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e6a858f3fe
commit
9a6fa83376
@ -54,7 +54,8 @@ def gitweb_all_repositories_private(session_browser):
|
||||
_set_all_repos_private(session_browser)
|
||||
|
||||
|
||||
@given(parsers.parse('a repository metadata:\n{metadata}'))
|
||||
@given(parsers.parse('a repository metadata:\n{metadata}'),
|
||||
target_fixture='gitweb_repo_metadata')
|
||||
def gitweb_repo_metadata(session_browser, metadata):
|
||||
metadata_dict = {}
|
||||
for item in metadata.split('\n'):
|
||||
@ -108,8 +109,8 @@ def gitweb_private_repo_should_exists(session_browser):
|
||||
|
||||
|
||||
@then('the repository should not be listed')
|
||||
def gitweb_repo_should_not_exist(session_browser, gitweb_repo):
|
||||
assert not _repo_exists(session_browser, gitweb_repo)
|
||||
def gitweb_repo_should_not_exist(session_browser):
|
||||
assert not _repo_exists(session_browser, 'Test-repo')
|
||||
|
||||
|
||||
@then('the public repository should be listed on gitweb')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user