Skip to content

Commit 2f3eae1

Browse files
committed
Add missing ending full stop to docstrings.
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent e6256bf commit 2f3eae1

15 files changed

+51
-57
lines changed

tests/actor/power_distributing/test_distribution_algorithm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
@dataclass
2525
class Bound:
26-
"""Class to create protobuf Bound"""
26+
"""Class to create protobuf Bound."""
2727

2828
lower: float
2929
upper: float
3030

3131

3232
@dataclass
3333
class Metric:
34-
"""Class to create protobuf Metric"""
34+
"""Class to create protobuf Metric."""
3535

3636
now: Optional[float]
3737
bound: Optional[Bound] = None
@@ -277,7 +277,7 @@ def test_distribute_power_three_batteries_2(self) -> None:
277277
assert result.remaining_power == approx(0.0)
278278

279279
def test_distribute_power_three_batteries_3(self) -> None:
280-
"""Test with batteries with no capacity"""
280+
"""Test with batteries with no capacity."""
281281
capacity: List[float] = [0, 49000, 0]
282282
components = self.create_components_with_capacity(3, capacity)
283283

@@ -568,7 +568,7 @@ def test_consumption_three_batteries_4(self) -> None:
568568
assert result.remaining_power == approx(200.0)
569569

570570
def test_consumption_three_batteries_5(self) -> None:
571-
"""Test what if some batteries has invalid SoC and capacity"""
571+
"""Test what if some batteries has invalid SoC and capacity."""
572572
capacity: List[Metric] = [Metric(98000), Metric(49000), Metric(0.0)]
573573
soc: List[Metric] = [
574574
Metric(80.0, Bound(0, 50)),

tests/actor/power_distributing/test_power_distributing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# License: MIT
22
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
33

4-
"""Tests power distributor"""
4+
"""Tests power distributor."""
55

66
from __future__ import annotations
77

@@ -41,7 +41,7 @@
4141

4242
class TestPowerDistributingActor:
4343
# pylint: disable=protected-access
44-
"""Test tool to distribute power"""
44+
"""Test tool to distribute power."""
4545

4646
_namespace = "power_distributor"
4747

tests/actor/test_actor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self) -> None:
4747
super().__init__(name="test")
4848

4949
async def _run(self) -> None:
50-
"""Start the actor and crash upon receiving a message"""
50+
"""Start the actor and crash upon receiving a message."""
5151
print(f"{self} started")
5252
self.inc_restart_count()
5353
print(f"{self} done")
@@ -69,7 +69,7 @@ def __init__(
6969
self._recv = recv
7070

7171
async def _run(self) -> None:
72-
"""Start the actor and crash upon receiving a message"""
72+
"""Start the actor and crash upon receiving a message."""
7373
print(f"{self} started")
7474
self.inc_restart_count()
7575
async for msg in self._recv:
@@ -94,7 +94,7 @@ def __init__(
9494
self._recv = recv
9595

9696
async def _run(self) -> None:
97-
"""Start the actor and crash upon receiving a message"""
97+
"""Start the actor and crash upon receiving a message."""
9898
print(f"{self} started")
9999
self.inc_restart_count()
100100
async for _ in self._recv:

tests/actor/test_battery_pool_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# pylint: disable=protected-access
2222
class TestBatteryPoolStatus:
23-
"""Tests for BatteryPoolStatus"""
23+
"""Tests for BatteryPoolStatus."""
2424

2525
async def test_batteries_status(self, mocker: MockerFixture) -> None:
2626
"""Basic tests for BatteryPoolStatus.

tests/actor/test_battery_status.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class TestBatteryStatus:
149149
async def test_sync_update_status_with_messages(
150150
self, mocker: MockerFixture
151151
) -> None:
152-
"""Test if messages changes battery status/
152+
"""Test if messages changes battery status.
153153
154154
Tests uses FakeSelect to test status in sync way.
155155
Otherwise we would have lots of async calls and waiting.
@@ -539,7 +539,7 @@ async def test_sync_blocking_interrupted_with_invalid_message(
539539

540540
@time_machine.travel("2022-01-01 00:00 UTC", tick=False)
541541
async def test_timers(self, mocker: MockerFixture) -> None:
542-
"""Test if messages changes battery status/
542+
"""Test if messages changes battery status.
543543
544544
Tests uses FakeSelect to test status in sync way.
545545
Otherwise we would have lots of async calls and waiting.
@@ -689,7 +689,7 @@ class TestBatteryStatusRecovery:
689689
async def setup_tracker(
690690
self, mocker: MockerFixture
691691
) -> AsyncIterator[tuple[MockMicrogrid, Receiver[Status]]]:
692-
"""Setup a BatteryStatusTracker instance to run tests with."""
692+
"""Set a BatteryStatusTracker instance up to run tests with."""
693693
mock_microgrid = MockMicrogrid(grid_meter=True)
694694
mock_microgrid.add_batteries(1)
695695
await mock_microgrid.start(mocker)

tests/actor/test_config_manager.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""Test for ConfigManager"""
4+
"""Test for ConfigManager."""
55
import pathlib
66

77
import pytest
@@ -15,7 +15,7 @@
1515

1616

1717
class Item(BaseModel):
18-
"""Test item"""
18+
"""Test item."""
1919

2020
item_id: int
2121
name: str
@@ -31,7 +31,7 @@ def create_content(number: int) -> str:
3131

3232

3333
class TestActorConfigManager:
34-
"""Test for ConfigManager"""
34+
"""Test for ConfigManager."""
3535

3636
conf_path = "sdk/config.toml"
3737
conf_content = """
@@ -71,11 +71,12 @@ def real_config_file(
7171
return file_path
7272

7373
async def test_update(self, config_file: pathlib.Path) -> None:
74-
"""
75-
Test ConfigManager by checking if:
74+
"""Test ConfigManager.
75+
76+
Check if:
77+
7678
- the initial content of the content file is correct
77-
- the config file modifications are picked up and the new content
78-
is correct
79+
- the config file modifications are picked up and the new content is correct
7980
"""
8081
config_channel: Broadcast[Config] = Broadcast(
8182
"Config Channel", resend_latest=True

tests/config/test_config.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""Test for Config"""
4+
"""Test for Config."""
55
import pathlib
66
import re
77

@@ -16,14 +16,14 @@
1616

1717

1818
class Item(BaseModel):
19-
"""Test item"""
19+
"""Test item."""
2020

2121
item_id: int
2222
name: str
2323

2424

2525
class TestConfig:
26-
"""Test for Config"""
26+
"""Test for Config."""
2727

2828
conf_path = "sdk/config.toml"
2929
conf_content = """
@@ -61,7 +61,7 @@ def conf_vars(self, config_file: pathlib.Path) -> dict[str, Any]:
6161
return tomllib.load(file)
6262

6363
def test_get(self, conf_vars: dict[str, Any]) -> None:
64-
"""Test get function"""
64+
"""Test get function."""
6565
config = Config(conf_vars=conf_vars)
6666

6767
assert config.get("logging_lvl") == "DEBUG"
@@ -70,7 +70,7 @@ def test_get(self, conf_vars: dict[str, Any]) -> None:
7070
assert config.get("var2", default=0) == 0
7171

7272
def test_getitem(self, conf_vars: dict[str, Any]) -> None:
73-
"""Test getitem function"""
73+
"""Test getitem function."""
7474
config = Config(conf_vars=conf_vars)
7575

7676
assert config["logging_lvl"] == "DEBUG"
@@ -79,7 +79,7 @@ def test_getitem(self, conf_vars: dict[str, Any]) -> None:
7979
assert config["var2"]
8080

8181
def test_contains(self, conf_vars: dict[str, Any]) -> None:
82-
"""Test contains function"""
82+
"""Test contains function."""
8383
config = Config(conf_vars=conf_vars)
8484

8585
assert "logging_lvl" in config
@@ -116,7 +116,7 @@ def test_contains(self, conf_vars: dict[str, Any]) -> None:
116116
def test_get_as_success(
117117
self, key: str, expected_type: Any, value: Any, conf_vars: dict[str, Any]
118118
) -> None:
119-
"""Test get_as function with proper arguments"""
119+
"""Test get_as function with proper arguments."""
120120

121121
config = Config(conf_vars=conf_vars)
122122
result = config.get_as(key, expected_type)
@@ -136,7 +136,7 @@ def test_get_as_success(
136136
def test_get_as_validation_error(
137137
self, key: str, expected_type: Any, conf_vars: dict[str, Any]
138138
) -> None:
139-
"""Test get_as function which raise ValidationError"""
139+
"""Test get_as function which raise ValidationError."""
140140
config = Config(conf_vars=conf_vars)
141141

142142
err_msg = (
@@ -161,7 +161,7 @@ def test_get_dict_values_success(
161161
value: Any,
162162
conf_vars: dict[str, Any],
163163
) -> None:
164-
"""Test get_as function with proper arguments"""
164+
"""Test get_as function with proper arguments."""
165165

166166
config = Config(conf_vars=conf_vars)
167167
result = config.get_dict(key_prefix, expected_values_type)
@@ -178,7 +178,7 @@ def test_get_dict_values_success(
178178
def test_get_dict_success(
179179
self, key_prefix: str, expected_values_type: Any, conf_vars: dict[str, Any]
180180
) -> None:
181-
"""Test get_as function with proper arguments"""
181+
"""Test get_as function with proper arguments."""
182182

183183
config = Config(conf_vars=conf_vars)
184184

tests/microgrid/test_microgrid_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""Tests of MicrogridApi"""
4+
"""Tests of MicrogridApi."""
5+
56
import asyncio
67
from asyncio.tasks import ALL_COMPLETED
78
from typing import List

tests/microgrid/test_timeout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"frequenz.sdk.microgrid.client._client.DEFAULT_GRPC_CALL_TIMEOUT", GRPC_CALL_TIMEOUT
4040
)
4141
async def test_components_timeout(mocker: MockerFixture) -> None:
42-
"""Test if the components() method properly raises AioRpcError"""
42+
"""Test if the components() method properly raises AioRpcError."""
4343
servicer = MockMicrogridServicer()
4444

4545
def mock_list_components(
@@ -66,7 +66,7 @@ def mock_list_components(
6666
"frequenz.sdk.microgrid.client._client.DEFAULT_GRPC_CALL_TIMEOUT", GRPC_CALL_TIMEOUT
6767
)
6868
async def test_connections_timeout(mocker: MockerFixture) -> None:
69-
"""Test if the connections() method properly raises AioRpcError"""
69+
"""Test if the connections() method properly raises AioRpcError."""
7070
servicer = MockMicrogridServicer()
7171

7272
def mock_list_connections(
@@ -93,7 +93,7 @@ def mock_list_connections(
9393
"frequenz.sdk.microgrid.client._client.DEFAULT_GRPC_CALL_TIMEOUT", GRPC_CALL_TIMEOUT
9494
)
9595
async def test_set_power_timeout(mocker: MockerFixture) -> None:
96-
"""Test if the set_power() method properly raises AioRpcError"""
96+
"""Test if the set_power() method properly raises AioRpcError."""
9797
servicer = MockMicrogridServicer()
9898

9999
def mock_set_power(

tests/test_sdk.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""
5-
Top level tests for the `frequenz.sdk` pacakge
6-
"""
4+
"""Top level tests for the `frequenz.sdk` pacakge."""
75

86
import frequenz.sdk
97
from frequenz.sdk import config
108
from frequenz.sdk.actor import ConfigManagingActor
119

1210

1311
def test_sdk_import() -> None:
14-
"""Checks that `import frequenz.sdk` works"""
12+
"""Checks that `import frequenz.sdk` works."""
1513
assert frequenz.sdk is not None
1614

1715

1816
def test_sdk_import_config() -> None:
19-
"""Checks that `import frequenz.sdk` works"""
17+
"""Checks that `import frequenz.sdk` works."""
2018
assert config is not None
2119

2220

2321
def test_sdk_import_config_manager() -> None:
24-
"""Checks that `import frequenz.sdk` works"""
22+
"""Checks that `import frequenz.sdk` works."""
2523
assert ConfigManagingActor is not None

0 commit comments

Comments
 (0)