Skip to content

Commit

Permalink
fix test import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
3ll3d00d committed Jan 5, 2021
1 parent abd3fc5 commit 917034e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec/
pip-log.txt
pip-delete-this-directory.txt

src/test/*.xml

# Unit test / coverage reports
htmlcov/
.tox/
Expand Down
4 changes: 3 additions & 1 deletion src/main/python/model/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from qtpy.QtWidgets import QDialog, QAbstractItemView, QHeaderView, QLineEdit, QToolButton, QListWidgetItem, QMessageBox

from model.batch import StoppableSpin, stop_spinner
from model.filter import FilterModel, FilterTableModel, FilterDialog
from model.iir import CompleteFilter, PeakingEQ, LowShelf, HighShelf
from model.limits import dBRangeCalculator
from model.magnitude import MagnitudeModel
Expand Down Expand Up @@ -47,6 +46,8 @@ def __init__(self, parent, prefs, signal_model):
self.syncLayout.addWidget(self.syncStatus)
self.ipAddress.setText(self.__preferences.get(HTP1_ADDRESS))
self.filterView.setSelectionBehavior(QAbstractItemView.SelectRows)

from model.filter import FilterModel, FilterTableModel
self.__filters = FilterModel(self.filterView, self.__preferences)
self.filterView.setModel(FilterTableModel(self.__filters))
self.filterView.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
Expand Down Expand Up @@ -779,6 +780,7 @@ def edit_filter(self):
item.setSelected(True)
else:
signal = self.__simple_signal
from model.filter import FilterDialog
FilterDialog(self.__preferences,
signal,
self.__filters,
Expand Down
13 changes: 9 additions & 4 deletions src/test/python/model/test_minidsp.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import io
import os

from model.iir import PeakingEQ, LowShelf
from model.merge import DspType
from model.minidsp import xml_to_filt, HDXmlParser


def test_codec_minidsp_xml():
from model.iir import PeakingEQ, LowShelf
from model.minidsp import xml_to_filt

filts = xml_to_filt(os.path.join(os.path.dirname(__file__), 'minidsp.xml'))
assert filts
assert len(filts) == 2
Expand All @@ -22,6 +21,8 @@ def test_codec_minidsp_xml():


def test_merge_2x4hd():
from model.minidsp import xml_to_filt, HDXmlParser
from model.merge import DspType
dsp_type = DspType.MINIDSP_TWO_BY_FOUR_HD
parser = HDXmlParser(dsp_type, False)
filt = xml_to_filt(os.path.join(os.path.dirname(__file__), 'input.xml'))
Expand All @@ -31,6 +32,8 @@ def test_merge_2x4hd():


def test_merge_2x4hd_output_with_output():
from model.merge import DspType
from model.minidsp import xml_to_filt, HDXmlParser
dsp_type = DspType.MINIDSP_TWO_BY_FOUR_HD
parser = HDXmlParser(dsp_type, False, selected_channels=[str(i) for i in range(1, 7)])
filt = xml_to_filt(os.path.join(os.path.dirname(__file__), 'input.xml'))
Expand All @@ -40,6 +43,8 @@ def test_merge_2x4hd_output_with_output():


def test_merge_2x4hd_output_with_split():
from model.minidsp import xml_to_filt, HDXmlParser
from model.merge import DspType
dsp_type = DspType.MINIDSP_TWO_BY_FOUR_HD
parser = HDXmlParser(dsp_type, False, in_out_split=['4', '6'])
filt = xml_to_filt(os.path.join(os.path.dirname(__file__), 'input.xml'))
Expand Down

0 comments on commit 917034e

Please sign in to comment.