Created
March 11, 2017 12:45
-
-
Save samj1912/df744464b55dde997bda7db49d7efed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_initial(self): | |
self.defaults = self.widget.options | |
for option in options: | |
if option.section == 'setting': | |
if isinstance(option, config.BoolOption): | |
self.assertEqual(getattr(self.widget.ui, option.name).isChecked(), config.setting[option.name]) | |
elif isinstance(option, config.TextOption): | |
self.assertEqual(getattr(self.widget.ui, option.name).value(), config.setting[option.name]) | |
def test_value_change(self): | |
self.widget.restore_defaults() | |
self.widget.ui.checkbox.click() | |
current_value = config.setting[option.name] | |
self.assertNotEqual(self.widget.ui.checkbox.isChecked(), current_value) | |
QTest.mouseClick(self.parent.ok_button, Qt.LeftButton) | |
self.assertNotEqual(config.setting[option.name], current_value) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment