Skip to content

Commit

Permalink
First round of unit tests for FilterDialog. (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcipriano committed Apr 13, 2020
1 parent 9ba86c8 commit 2480183
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 4 deletions.
18 changes: 14 additions & 4 deletions cuegui/cuegui/FilterDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@

class FilterDialog(QtWidgets.QDialog):
def __init__(self, show, parent=None):
"""
Creates an instance of the FilterDialog.
Filters are segmented by show, so a show must be provided.
:type show: opencue.wrappers.show.Show
:param show: the show to manage filters for
:type parent: PySide2.QtWidgets.QWidget.QWidget
:param parent: the parent widget
"""
QtWidgets.QDialog.__init__(self, parent)
self.__show = show

Expand Down Expand Up @@ -112,8 +122,8 @@ def __init__(self, show, parent=None):

def __createFilter(self):
"""Prompts the user to create a new filter"""
(value, choice) = QtWidgets.QInputDialog.getText(self, "Add filter", "Filter name?",
QtWidgets.QLineEdit.Normal, "")
(value, choice) = QtWidgets.QInputDialog.getText(
self, "Add filter", "Filter name?", QtWidgets.QLineEdit.Normal, "")
if choice:
self.__filters.addObject(self.__show.createFilter(str(value)))

Expand Down Expand Up @@ -258,8 +268,8 @@ def createMatcher(self):
return

self.addObject(self.__filter.createMatcher(
getattr(opencue.api.filter_pb2, str(matchSubject)),
getattr(opencue.api.filter_pb2, str(matchType)),
opencue.compiled_proto.filter_pb2.MatchSubject.Value(str(matchSubject)),
opencue.compiled_proto.filter_pb2.MatchType.Value(str(matchType)),
str(input)))

def deleteAllMatchers(self):
Expand Down

0 comments on commit 2480183

Please sign in to comment.