-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some more ruff and pylint findings
- Loading branch information
Showing
11 changed files
with
90 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
"""Constants for aioelectricitymaps.""" | ||
API_BASE_URL = "https://api-access.electricitymaps.com/free-tier/" | ||
|
||
LEGACY_API_BASE_URL = "https://api.co2signal.com/v1/" | ||
|
||
|
||
class ApiEndpoints: | ||
"""Class holding API endpoints.""" | ||
|
||
LEGACY_CARBON_INTENSITY = LEGACY_API_BASE_URL + "latest" | ||
CARBON_INTENSITY = API_BASE_URL + "home-assistant" | ||
ZONES = "https://api.electricitymap.org/v3/zones" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
"""Helpers for the tests.""" | ||
import os | ||
from pathlib import Path | ||
|
||
|
||
def load_fixture(filename): | ||
def load_fixture(filename: str) -> str: | ||
"""Load a fixture.""" | ||
path = os.path.join(os.path.dirname(__file__), "fixtures", filename) | ||
with open(path, encoding="utf-8") as fptr: | ||
return fptr.read() | ||
path = Path(__file__).parent / "fixtures" / filename | ||
return path.read_text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This extend our general Ruff rules specifically for tests | ||
extend = "../pyproject.toml" | ||
|
||
extend-select = [ | ||
"PT", # Use @pytest.fixture without parentheses | ||
] | ||
|
||
extend-ignore = [ | ||
"S101", # Use of assert detected. As these are tests... | ||
"S105", # Detection of passwords... | ||
"S106", # Detection of passwords... | ||
"SLF001", # Tests will access private/protected members... | ||
"TCH002", # pytest doesn't like this one... | ||
"PLR0913", # we're overwriting function that has many arguments | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters