mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Fixed test
This commit is contained in:
parent
2e44ecd460
commit
09beca6af7
2 changed files with 6 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import sounddevice
|
|||
from enum import auto
|
||||
from typing import Optional, Tuple, Any
|
||||
|
||||
from PyQt6.QtCore import QThread, Qt, QThreadPool, QTimer
|
||||
from PyQt6.QtCore import QThread, Qt, QThreadPool, QTimer, pyqtSignal
|
||||
from PyQt6.QtGui import QTextCursor, QCloseEvent, QColor
|
||||
from PyQt6.QtWidgets import (
|
||||
QWidget,
|
||||
|
|
@ -71,6 +71,8 @@ class RecordingTranscriberWidget(QWidget):
|
|||
recording_amplitude_listener: Optional[RecordingAmplitudeListener] = None
|
||||
device_sample_rate: Optional[int] = None
|
||||
|
||||
transcription_stopped = pyqtSignal()
|
||||
|
||||
class RecordingStatus(enum.Enum):
|
||||
STOPPED = auto()
|
||||
RECORDING = auto()
|
||||
|
|
@ -1045,6 +1047,7 @@ class RecordingTranscriberWidget(QWidget):
|
|||
self.reset_record_button()
|
||||
# Restart amplitude listener now that the transcription stream is closed
|
||||
self.reset_recording_amplitude_listener()
|
||||
self.transcription_stopped.emit()
|
||||
|
||||
def on_transcriber_error(self, error: str):
|
||||
self.reset_record_button()
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class TestRecordingTranscriberWidget:
|
|||
widget.record_button.click()
|
||||
qtbot.wait_until(callback=assert_text_box_contains_text, timeout=60 * 1000)
|
||||
|
||||
with qtbot.wait_signal(widget.transcription_thread.finished, timeout=60 * 1000):
|
||||
with qtbot.wait_signal(widget.transcription_stopped, timeout=60 * 1000):
|
||||
widget.stop_recording()
|
||||
|
||||
assert len(widget.transcription_text_box.toPlainText()) > 0
|
||||
|
|
@ -104,7 +104,7 @@ class TestRecordingTranscriberWidget:
|
|||
widget.record_button.click()
|
||||
qtbot.wait_until(callback=assert_text_box_contains_text, timeout=60 * 1000)
|
||||
|
||||
with qtbot.wait_signal(widget.transcription_thread.finished, timeout=60 * 1000):
|
||||
with qtbot.wait_signal(widget.transcription_stopped, timeout=60 * 1000):
|
||||
widget.stop_recording()
|
||||
|
||||
assert len(widget.transcription_text_box.toPlainText()) > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue