#17 and #25 #26

Merged
d merged 12 commits from issues-17 into main 2023-04-24 22:09:32 +00:00
Member

fix #17
fix #25

fix #17 fix #25
fix
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
c3449aea59
fix named tuple
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
9dbf065c73
fix tests
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
7f0d97b68f
fix tests
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
aec0a598c7
sort tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
15913e7ec9
d requested changes 2023-04-23 18:33:04 +00:00
@ -11,6 +13,19 @@ from src.weather.weathercoding import (
)
class CityData(NamedTuple):
Owner

Этот namedtuple по факту состоит из других namedtuple (weatherdata и geodata), не добавляя ничего нового, мб лучше использовать их напрямую?

Этот namedtuple по факту состоит из других namedtuple (weatherdata и geodata), не добавляя ничего нового, мб лучше использовать их напрямую?
Idvon marked this conversation as resolved
@ -10,0 +18,4 @@
api_key: str
class Timeout(NamedTuple):
Owner

А зачем Namedtuple из одного поля?

А зачем Namedtuple из одного поля?
Idvon marked this conversation as resolved
@ -87,0 +82,4 @@
f"Humidity: {data['hum']} %\n"
f"Wind speed: {data['windspeed']} m/s\n"
f"Wind direction: {data['winddir']}\n"
f"By {data['provider']}"
Owner

одно из преимуществ namedtuple в том что не надо обращаться к атрибутам через квадратные скобки, а можно просто писать data.provider

одно из преимуществ namedtuple в том что не надо обращаться к атрибутам через квадратные скобки, а можно просто писать `data.provider`
Idvon marked this conversation as resolved
@ -32,0 +35,4 @@
assert json_parser.get_weather_config() == WeatherConfig(
"openweather",
"weather api key",
)
Owner

Это можно убрать если timeout будет просто int

Это можно убрать если timeout будет просто int
Idvon marked this conversation as resolved
@ -24,2 +30,3 @@
@freeze_time("2023-01-01 00:00:00.000000+00:00")
def test_openweather_parsing(mock_openweather_get):
provider = OpenWeatherWeatherProvider({"api_key": "beepboop"}, COORDS)
provider = OpenWeatherWeatherProvider(WeatherConfig, Coords)
Owner

Почему работает с Coords? Это же класс

Почему работает с Coords? Это же класс
d marked this conversation as resolved
d approved these changes 2023-04-24 22:09:20 +00:00
d merged commit da6b8de93e into main 2023-04-24 22:09:32 +00:00
d referenced this pull request from a commit 2023-04-24 22:09:33 +00:00
d deleted branch issues-17 2023-04-24 22:09:33 +00:00
Sign in to join this conversation.
No description provided.