forked from openlp/openlp
PEP8 fixes
This commit is contained in:
parent
dc3cd41576
commit
1efc145cdf
@ -125,7 +125,6 @@ class InfoLabel(QtGui.QLabel):
|
|||||||
alignment = QtCore.Qt.AlignLeft
|
alignment = QtCore.Qt.AlignLeft
|
||||||
painter.drawText(self.rect(), alignment, elided)
|
painter.drawText(self.rect(), alignment, elided)
|
||||||
|
|
||||||
|
|
||||||
def setText(self, text):
|
def setText(self, text):
|
||||||
"""
|
"""
|
||||||
Reimplemented to set the tool tip text.
|
Reimplemented to set the tool tip text.
|
||||||
|
@ -560,6 +560,7 @@ class TestSlideController(TestCase):
|
|||||||
mocked_preview_widget.change_slide.assert_called_once_with(7)
|
mocked_preview_widget.change_slide.assert_called_once_with(7)
|
||||||
mocked_slide_selected.assert_called_once_with()
|
mocked_slide_selected.assert_called_once_with()
|
||||||
|
|
||||||
|
|
||||||
class TestInfoLabel(TestCase):
|
class TestInfoLabel(TestCase):
|
||||||
|
|
||||||
def paint_event_text_fits_test(self):
|
def paint_event_text_fits_test(self):
|
||||||
|
@ -54,7 +54,6 @@ class TestThemeManager(TestCase):
|
|||||||
**{'return_value': ''}) as mocked_get_open_file_name,\
|
**{'return_value': ''}) as mocked_get_open_file_name,\
|
||||||
patch('openlp.core.ui.themeform.translate', **{'return_value': 'Translated String'}),\
|
patch('openlp.core.ui.themeform.translate', **{'return_value': 'Translated String'}),\
|
||||||
patch('openlp.core.ui.ThemeForm.set_background_page_values') as mocked_set_background_page_values:
|
patch('openlp.core.ui.ThemeForm.set_background_page_values') as mocked_set_background_page_values:
|
||||||
|
|
||||||
instance = ThemeForm(None)
|
instance = ThemeForm(None)
|
||||||
mocked_image_file_edit = MagicMock()
|
mocked_image_file_edit = MagicMock()
|
||||||
mocked_image_file_edit.text.return_value = '/original_path/file.ext'
|
mocked_image_file_edit.text.return_value = '/original_path/file.ext'
|
||||||
@ -66,8 +65,8 @@ class TestThemeManager(TestCase):
|
|||||||
# THEN: The QFileDialog getOpenFileName and set_background_page_values moethods should have been called
|
# THEN: The QFileDialog getOpenFileName and set_background_page_values moethods should have been called
|
||||||
# with known arguments
|
# with known arguments
|
||||||
mocked_get_open_file_name.assert_called_once_with(instance, 'Translated String', '/original_path/file.ext',
|
mocked_get_open_file_name.assert_called_once_with(instance, 'Translated String', '/original_path/file.ext',
|
||||||
'Image Files (*.bmp; *.gif)(*.bmp *.gif);;All Files (*.*)'
|
'Image Files (*.bmp; *.gif)(*.bmp *.gif);;'
|
||||||
)
|
'All Files (*.*)')
|
||||||
mocked_set_background_page_values.assert_called_once_with()
|
mocked_set_background_page_values.assert_called_once_with()
|
||||||
|
|
||||||
def select_image_file_dialog_new_file_test(self):
|
def select_image_file_dialog_new_file_test(self):
|
||||||
@ -82,7 +81,6 @@ class TestThemeManager(TestCase):
|
|||||||
**{'return_value': '/new_path/file.ext'}) as mocked_get_open_file_name,\
|
**{'return_value': '/new_path/file.ext'}) as mocked_get_open_file_name,\
|
||||||
patch('openlp.core.ui.themeform.translate', **{'return_value': 'Translated String'}),\
|
patch('openlp.core.ui.themeform.translate', **{'return_value': 'Translated String'}),\
|
||||||
patch('openlp.core.ui.ThemeForm.set_background_page_values') as mocked_background_page_values:
|
patch('openlp.core.ui.ThemeForm.set_background_page_values') as mocked_background_page_values:
|
||||||
|
|
||||||
instance = ThemeForm(None)
|
instance = ThemeForm(None)
|
||||||
mocked_image_file_edit = MagicMock()
|
mocked_image_file_edit = MagicMock()
|
||||||
mocked_image_file_edit.text.return_value = '/original_path/file.ext'
|
mocked_image_file_edit.text.return_value = '/original_path/file.ext'
|
||||||
@ -95,8 +93,8 @@ class TestThemeManager(TestCase):
|
|||||||
# THEN: The QFileDialog getOpenFileName and set_background_page_values moethods should have been called
|
# THEN: The QFileDialog getOpenFileName and set_background_page_values moethods should have been called
|
||||||
# with known arguments and theme.background_filename should be set
|
# with known arguments and theme.background_filename should be set
|
||||||
mocked_get_open_file_name.assert_called_once_with(instance, 'Translated String', '/original_path/file.ext',
|
mocked_get_open_file_name.assert_called_once_with(instance, 'Translated String', '/original_path/file.ext',
|
||||||
'Image Files (*.bmp; *.gif)(*.bmp *.gif);;All Files (*.*)'
|
'Image Files (*.bmp; *.gif)(*.bmp *.gif);;'
|
||||||
)
|
'All Files (*.*)')
|
||||||
self.assertEqual(instance.theme.background_filename, '/new_path/file.ext',
|
self.assertEqual(instance.theme.background_filename, '/new_path/file.ext',
|
||||||
'theme.background_filename should be set to the path that the file dialog returns')
|
'theme.background_filename should be set to the path that the file dialog returns')
|
||||||
mocked_background_page_values.assert_called_once_with()
|
mocked_background_page_values.assert_called_once_with()
|
||||||
|
Loading…
Reference in New Issue
Block a user