correct Missing Type Annotations #6

This commit is contained in:
Thomas Franks 2022-08-18 15:42:52 -04:00
parent 74f9928581
commit cc4a529abc

View file

@ -30,16 +30,16 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git"
class Fake_Requests:
"""For faking 'requests' using a local file instead of the network."""
def __init__(self, filename):
def __init__(self, filename: str) -> None:
self._filename = filename
def json(self):
def json(self) -> str:
"""json parsed version for local requests."""
with open(self._filename, "r") as file:
return json.load(file)
@property
def text(self):
def text(self) -> str:
"""raw text version for local requests."""
with open(self._filename, "r") as file:
return file.read()