Skip to content

Instantly share code, notes, and snippets.

@samj1912
Created March 11, 2017 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samj1912/df744464b55dde997bda7db49d7efed1 to your computer and use it in GitHub Desktop.
Save samj1912/df744464b55dde997bda7db49d7efed1 to your computer and use it in GitHub Desktop.
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