mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
21 lines
877 B
Python
21 lines
877 B
Python
"""Media transfer through the real HTTP/SSH path; the fake has no VR renderer."""
|
|
import harness
|
|
from harness import ok, ssh
|
|
|
|
harness.require()
|
|
|
|
|
|
class Media(harness.FrameTestCase):
|
|
def test_upload_and_list_without_launching_a_viewer(self):
|
|
# The transfer endpoint doesn't decode. Rendering belongs to the real
|
|
# headset smoke checks documented in docs/vr-video.md.
|
|
result = ok('POST', '/api/upload', raw=b'fake-media', headers={
|
|
'X-Mode': 'media', 'X-Filename': 'test_SBS.png'})
|
|
identity = result['id']
|
|
try:
|
|
files = ok('POST', '/api/media', {'action': 'list'})['files']
|
|
self.assertIn(identity, [f['id'] for f in files])
|
|
self.assertEqual(ssh('cat ~/Videos/FrameControl/'+identity), 'fake-media')
|
|
finally:
|
|
ssh('rm -rf ~/Videos/FrameControl/'+identity.split('/')[0])
|