Skip to content

Commit

Permalink
fixed test for last nc_py_api version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Aug 22, 2023
1 parent efa55ea commit b8ebb95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/app_version_higher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

nc_application = NextcloudApp(user="admin")
assert nc_application.users.get_details() # OCS call works
assert not nc_application.users.notifications.get_all() # there are no notifications
assert not nc_application.notifications.get_all() # there are no notifications
nc_application._session.adapter.headers.update({"EX-APP-VERSION": "99.0.0"}) # change ExApp version
with pytest.raises(NextcloudException) as exc_info:
nc_application.users.get_details() # this call should be rejected by AppEcosystem
assert exc_info.value.status_code == 401

assert nc_client.apps.ex_app_is_disabled("nc_py_api") is True
notifications = nc_client.users.notifications.get_all()
notifications = nc_client.notifications.get_all()
notification = [i for i in notifications if i.object_type == "ex_app_update"]
assert len(notification) == 1 # only one notification for each admin
nc_client = Nextcloud(nc_auth_user="second_admin", nc_auth_pass="2Very3Strong4")
notifications = nc_client.users.notifications.get_all()
notifications = nc_client.notifications.get_all()
notification = [i for i in notifications if i.object_type == "ex_app_update"]
assert len(notification) == 1 # only one notification for each admin

0 comments on commit b8ebb95

Please sign in to comment.