mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-31 01:49:29 +02:00
move stream mode to query parameter (#1089)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from facefusion.apis.api_helper import get_sec_websocket_protocol
|
||||
|
||||
|
||||
def test_get_sec_websocket_protocol() -> None:
|
||||
scope =\
|
||||
{
|
||||
'type': 'websocket',
|
||||
'headers': [ (b'sec-websocket-protocol', b'access_token.abc') ]
|
||||
}
|
||||
|
||||
assert get_sec_websocket_protocol(scope) == 'access_token.abc'
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from facefusion.apis.stream_helper import calculate_bitrate, calculate_buffer_size, detect_websocket_stream_mode, read_pipe_buffer
|
||||
from facefusion.apis.stream_helper import calculate_bitrate, calculate_buffer_size, read_pipe_buffer
|
||||
|
||||
|
||||
def test_calculate_bitrate() -> None:
|
||||
@@ -19,24 +19,6 @@ def test_calculate_buffer_size() -> None:
|
||||
assert calculate_buffer_size((3840, 2160)) == 14000
|
||||
|
||||
|
||||
def test_detect_websocket_stream_mode() -> None:
|
||||
scope =\
|
||||
{
|
||||
'type': 'websocket',
|
||||
'headers': [ (b'sec-websocket-protocol', b'image') ]
|
||||
}
|
||||
|
||||
assert detect_websocket_stream_mode(scope) == 'image'
|
||||
|
||||
scope =\
|
||||
{
|
||||
'type': 'websocket',
|
||||
'headers': [ (b'sec-websocket-protocol', b'video') ]
|
||||
}
|
||||
|
||||
assert detect_websocket_stream_mode(scope) == 'video'
|
||||
|
||||
|
||||
def test_read_pipe_buffer() -> None:
|
||||
read_pipe, write_pipe = os.pipe()
|
||||
os.write(write_pipe, b'123456')
|
||||
|
||||
Reference in New Issue
Block a user