Skip to content

Commit

Permalink
ex_apps: removed deprecated fields last_check_time and system
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Sep 5, 2024
1 parent ed23e05 commit 3cde102
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
13 changes: 0 additions & 13 deletions nc_py_api/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Nextcloud API for working with applications."""

import dataclasses
import datetime

from ._misc import require_capabilities
from ._session import AsyncNcSessionBasic, NcSessionBasic
Expand Down Expand Up @@ -34,18 +33,6 @@ def enabled(self) -> bool:
"""Flag indicating if the application enabled."""
return bool(self._raw_data["enabled"])

@property
def last_check_time(self) -> datetime.datetime:
"""Time of the last successful application check."""
return datetime.datetime.utcfromtimestamp(int(self._raw_data["last_check_time"])).replace(
tzinfo=datetime.timezone.utc
)

@property
def system(self) -> bool:
"""**DEPRECATED** Flag indicating if the application is a system application."""
return True

def __repr__(self):
return f"<{self.__class__.__name__} id={self.app_id}, ver={self.version}>"

Expand Down
3 changes: 0 additions & 3 deletions tests/actual_tests/apps_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import datetime

import pytest

from nc_py_api.apps import ExAppInfo
Expand Down Expand Up @@ -121,7 +119,6 @@ def _test_ex_app_get_list(ex_apps: list[ExAppInfo], enabled_ex_apps: list[ExAppI
assert isinstance(app.name, str)
assert isinstance(app.version, str)
assert isinstance(app.enabled, bool)
assert isinstance(app.last_check_time, datetime.datetime)
assert str(app).find("id=") != -1 and str(app).find("ver=") != -1


Expand Down

0 comments on commit 3cde102

Please sign in to comment.