correct Missing Type Annotations #6
This commit is contained in:
parent
74f9928581
commit
cc4a529abc
1 changed files with 3 additions and 3 deletions
|
|
@ -30,16 +30,16 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git"
|
||||||
class Fake_Requests:
|
class Fake_Requests:
|
||||||
"""For faking 'requests' using a local file instead of the network."""
|
"""For faking 'requests' using a local file instead of the network."""
|
||||||
|
|
||||||
def __init__(self, filename):
|
def __init__(self, filename: str) -> None:
|
||||||
self._filename = filename
|
self._filename = filename
|
||||||
|
|
||||||
def json(self):
|
def json(self) -> str:
|
||||||
"""json parsed version for local requests."""
|
"""json parsed version for local requests."""
|
||||||
with open(self._filename, "r") as file:
|
with open(self._filename, "r") as file:
|
||||||
return json.load(file)
|
return json.load(file)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def text(self):
|
def text(self) -> str:
|
||||||
"""raw text version for local requests."""
|
"""raw text version for local requests."""
|
||||||
with open(self._filename, "r") as file:
|
with open(self._filename, "r") as file:
|
||||||
return file.read()
|
return file.read()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue