Skip to content

Commit

Permalink
readd
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgross committed Jun 24, 2023
1 parent 2929669 commit ceb9ff5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/pcloud/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ def deletetoken(self, **kwargs):
return self._do_request("deletetoken", **kwargs)

# Streaming
def getfilelink(self, **kwargs):
raise OnlyPcloudError(ONLY_PCLOUD_MSG)

def getvideolink(self, **kwargs):
raise OnlyPcloudError(ONLY_PCLOUD_MSG)

Expand Down
15 changes: 10 additions & 5 deletions src/pcloud/tests/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ class MockHandler(BaseHTTPRequestHandler):
# Handler for GET requests
def do_GET(self):
# Send the json message
method = self.path[1:].split("?")
methodparts = self.path[1:].split("?")
basepath = path.join(path.dirname(__file__), "data")
safemethod = path.realpath(method[0] + ".json")
method = path.join(basepath, methodparts[0] + ".json")
safemethod = path.realpath(method)
prefix = path.commonpath((basepath, safemethod))
if prefix == basepath:
code = 200
with open(path.join(basepath, safemethod)) as f:
data = f.read()
try:
code = 200
with open(safemethod) as f:
data = f.read()
except FileNotFoundError:
code = 404
data = '{"Error": "Path not found or not accessible!"}'
else:
code = 404
data = '{"Error": "Path not found or not accessible!"}'
Expand Down

0 comments on commit ceb9ff5

Please sign in to comment.