Skip to content

Commit

Permalink
update testsuite: new endpoint '/fs'
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleO8 committed Oct 30, 2017
1 parent 401f07a commit 0834751
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions testsuite/movie_files_testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import copy
import unittest
import urllib
import uuid
import tempfile

Expand Down Expand Up @@ -68,12 +67,12 @@ def setUp(self):
with open(self.test_file, "wb") as tgt:
tgt.write("TEST1234")
self.enigma2_host = os.environ.get(ENV_VAR, ENV_VAL_FALLBACK)
self.file_controller_url = "http://{netloc}/file?dir={dir}".format(
self.file_controller_url = "http://{netloc}/fs?dir={dir}".format(
netloc=self.enigma2_host, dir=MOVIE_FOLDER)
self.api_controller_url = "http://{netloc}/api/movielist".format(
netloc=self.enigma2_host)
self.file_url = 'http://{host}/file'.format(host=self.enigma2_host)
self.testfile_upload_url = "http://{netloc}/file{dir}".format(
self.file_url = 'http://{host}/fs'.format(host=self.enigma2_host)
self.testfile_upload_url = "http://{netloc}/fs{dir}".format(
netloc=self.enigma2_host, dir=MOVIE_FOLDER)

def testFilesResponseByFileController(self):
Expand Down Expand Up @@ -103,20 +102,6 @@ def testFilesResponseByApiController(self):
self.assertEqual("Animal Kingdom", movie_item['eventname'])
self.assertEqual(movie_item, EXPECTED_MOVIE_ITEM)

def test_etc_passwd_stream(self):
params = {
"file": MAIN_TS_FILE,
"action": "stream",
}
req = requests.get(self.file_url, params=params)
print("Tried to fetch {!r}".format(req.url))
# print(req.text)
expected_body = '#EXTM3U\n#EXTVLCOPT--http-reconnect=true\n#EXTINF:-1,stream\nhttp://{netloc}:80/file?action=download&file={file}'.format(
netloc=self.enigma2_host,
file=urllib.quote(MAIN_TS_FILE.encode("utf_8")))
self.assertEquals(expected_body, req.text)
self.assertEqual(200, req.status_code)

def testUpload(self):
files = {
"data": open(self.test_file, "rb")
Expand Down

0 comments on commit 0834751

Please sign in to comment.