Skip to content

Commit

Permalink
start testing streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
dimastatz committed Mar 10, 2024
1 parent d1301a9 commit 8ca9eb0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"deepsignal"
"deepsignal",
"librosa"
],
"python.testing.pytestArgs": [
"."
Expand Down
12 changes: 12 additions & 0 deletions python/tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
""" streaming """
import os
import pytest
import librosa
from deepsignal import app as flask_app


Expand Down Expand Up @@ -38,3 +40,13 @@ def test_index(test_flask_client, test_socketio):
test_socketio.send("test message 2")
result = test_socketio.get_received()
assert result[0]["args"][0]["data"] == "test message 2"


def test_audio_stream(test_socketio):
"""test audio stream"""
result = test_socketio.get_received()
assert len(result) == 1

path = os.getcwd() + "/tests/resources/sample-4.mp3"
buffer, _ = librosa.load(path)
assert len(buffer) > 0

0 comments on commit 8ca9eb0

Please sign in to comment.