'Test saving and restoring gui state'

def test_gui_save_restore(self):

    settings = self.new_settings()
    settings.gui_state[u'test-gui'] = {u'foo': u'bar'}
    settings.save()
    settings = self.new_settings()
    state = settings.gui_state.get(u'test-gui', {})
    self.assertTrue((u'foo' in state))
    self.assertEqual(state[u'foo'], u'bar')
