Compare commits

...

3 Commits
0.67.0 ... 0.68

Author SHA1 Message Date
Mieszko Bańczerowski
947c578121 Increment version 2021-04-20 13:26:30 +02:00
Mieszko Banczerowski
aba9b0ed6b PLINT-575 set galaxy package logging level to INFO 2021-04-20 11:45:48 +02:00
Albert Suralinski
f0d65a72ff PLINT-139 added default values for optional UserInfo dataclass parameters 2020-12-03 10:02:25 +01:00
6 changed files with 17 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="galaxy.plugin.api",
version="0.67.0",
version="0.68",
description="GOG Galaxy Integrations Python API",
author='Galaxy team',
author_email='galaxy@gog.com',

View File

@@ -1 +1,6 @@
__path__: str = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
import logging
logging.getLogger(__name__).setLevel(logging.INFO)
__path__: str = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore

View File

@@ -306,7 +306,7 @@ class Connection():
if sensitive:
logger.debug("Sending %d bytes of data", len(data))
else:
logging.debug("Sending data: %s", line)
logger.debug("Sending data: %s", line)
self._writer.write(data)
except TypeError as error:
logger.error(str(error))

View File

@@ -292,7 +292,7 @@ class Plugin:
await self._external_task_manager.wait()
await self._internal_task_manager.wait()
await self._connection.wait_closed()
logger.debug("Plugin closed")
logger.info("Plugin closed")
def create_task(self, coro, description):
"""Wrapper around asyncio.create_task - takes care of canceling tasks on shutdown"""

View File

@@ -166,8 +166,8 @@ class UserInfo:
"""
user_id: str
user_name: str
avatar_url: Optional[str]
profile_url: Optional[str]
avatar_url: Optional[str] = None
profile_url: Optional[str] = None
@dataclass

View File

@@ -18,7 +18,9 @@ async def test_get_friends_success(plugin, read, write):
read.side_effect = [async_return_value(create_message(request)), async_return_value(b"", 10)]
plugin.get_friends.return_value = async_return_value([
UserInfo("3", "Jan", "https://avatar.url/u3", None),
UserInfo("5", "Ola", None, "https://profile.url/u5")
UserInfo("5", "Ola", None, "https://profile.url/u5"),
UserInfo("6", "Ola2", None),
UserInfo("7", "Ola3"),
])
await plugin.run()
plugin.get_friends.assert_called_with()
@@ -30,7 +32,9 @@ async def test_get_friends_success(plugin, read, write):
"result": {
"friend_info_list": [
{"user_id": "3", "user_name": "Jan", "avatar_url": "https://avatar.url/u3"},
{"user_id": "5", "user_name": "Ola", "profile_url": "https://profile.url/u5"}
{"user_id": "5", "user_name": "Ola", "profile_url": "https://profile.url/u5"},
{"user_id": "6", "user_name": "Ola2"},
{"user_id": "7", "user_name": "Ola3"},
]
}
}