File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import json
25
25
26
+ try :
27
+ from typing import Any
28
+ except ImportError :
29
+ pass
30
+
26
31
__version__ = "0.0.0+auto.0"
27
32
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git"
28
33
29
34
30
35
class Fake_Requests :
31
36
"""For faking 'requests' using a local file instead of the network."""
32
37
33
- def __init__ (self , filename ) :
38
+ def __init__ (self , filename : str ) -> None :
34
39
self ._filename = filename
35
40
36
- def json (self ):
41
+ def json (self ) -> Any :
37
42
"""json parsed version for local requests."""
38
43
with open (self ._filename , "r" ) as file :
39
44
return json .load (file )
40
45
41
46
@property
42
- def text (self ):
47
+ def text (self ) -> str :
43
48
"""raw text version for local requests."""
44
49
with open (self ._filename , "r" ) as file :
45
50
return file .read ()
You can’t perform that action at this time.
0 commit comments