class TestRecently(unittest.TestCase): def setUp(self): self.window = UbuntuTweakWindow() self.window.loaded_modules = {} self.window.modules_index = {} self.window.navigation_dict = {'tweaks': [None, None]} self.setting = GSetting('com.ubuntu-tweak.tweak.recently-used') def test_recently(self): self.setting.set_value([]) self.assertEqual(self.setting.get_value(), []) self.window._load_module('Icons') self.assertEqual(self.setting.get_value(), ['Icons']) self.window._load_module('Nautilus') self.assertEqual(self.setting.get_value(), ['Nautilus', 'Icons']) def tearDown(self): self.setting.set_value([]) del self.window
class TestRencently(unittest.TestCase): def setUp(self): self.window = UbuntuTweakWindow() self.window.loaded_modules = {} self.window.modules_index = {} self.window.navigation_dict = {'tweaks': [None, None]} self.setting = GSetting('com.ubuntu-tweak.tweak.rencently-used') def test_rencetly(self): self.setting.set_value([]) self.assertEqual(self.setting.get_value(), []) self.window.load_module('Icon') self.assertEqual(self.setting.get_value(), ['Icon']) self.window.load_module('Nautilus') self.assertEqual(self.setting.get_value(), ['Nautilus', 'Icon']) def tearDown(self): self.setting.set_value([]) del self.window
def setUp(self): self.window = UbuntuTweakWindow() self.window.loaded_modules = {} self.window.modules_index = {} self.window.navigation_dict = {'tweaks': [None, None]} self.setting = GSetting('com.ubuntu-tweak.tweak.rencently-used')
class TestApp(unittest.TestCase): def setUp(self): self.window = UbuntuTweakWindow() def test_app(self): # tweaks self.window.select_target_feature('tweaks') self.assertEqual(self.window.loaded_modules, {}) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual( self.window.feature_dict, { 'overview': 0, 'apps': 1, 'tweaks': 2, 'admins': 3, 'janitor': 4, 'search': 6, 'wait': 5 }) self.assertEqual(self.window.navigation_dict, {'tweaks': (None, None)}) # tweaks->Nautilus self.window._load_module('Nautilus') self.assertEqual(self.window.loaded_modules, {'Nautilus': 7}) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Nautilus', None)}) # Nautilus->tweaks self.window.on_back_button_clicked(None) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': (None, 'Nautilus')}) # tweaks->Compiz self.window._load_module('Window') self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Window', None)}) def todo(self): #TODO toggled has different behavir # admins->DesktopRecovery self.window._load_module('DesktopRecovery') self.window.admins_button.toggled() self.assertEqual(self.window.current_feature, 'admins') self.assertEqual(self.window.navigation_dict, { 'tweaks': ('Compiz', None), 'admins': ('DesktopRecovery', None) }) # DesktopRecovery->admins self.window.on_back_button_clicked(None) self.assertEqual(self.window.current_feature, 'admins') self.assertEqual(self.window.navigation_dict, { 'tweaks': ('Compiz', None), 'admins': (None, 'DesktopRecovery') }) # tweaks->Compiz self.window.select_target_feature('tweaks') self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, { 'tweaks': ('Compiz', None), 'admins': (None, 'DesktopRecovery') }) def tearDown(self): del self.window
def setUp(self): self.window = UbuntuTweakWindow()
class TestApp(unittest.TestCase): def setUp(self): self.window = UbuntuTweakWindow() def test_app(self): # tweaks self.window.select_target_feature('tweaks') self.assertEqual(self.window.loaded_modules, {}) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.feature_dict, {'overview': 0, 'tweaks': 1, 'admins': 2, 'janitor': 3, 'search': 5, 'wait': 4}) self.assertEqual(self.window.navigation_dict, {'tweaks': (None, None)}) # tweaks->Nautilus self.window._load_module('Nautilus') self.assertEqual(self.window.loaded_modules, {'Nautilus': 6}) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Nautilus', None)}) # Nautilus->tweaks self.window.on_back_button_clicked(None) self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': (None, 'Nautilus')}) # tweaks->Compiz self.window._load_module('Window') self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Window', None)}) def todo(self): #TODO toggled has different behavir # admins->DesktopRecovery self.window._load_module('DesktopRecovery') self.window.admins_button.toggled() self.assertEqual(self.window.current_feature, 'admins') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Compiz', None), 'admins': ('DesktopRecovery', None)}) # DesktopRecovery->admins self.window.on_back_button_clicked(None) self.assertEqual(self.window.current_feature, 'admins') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Compiz', None), 'admins': (None, 'DesktopRecovery')}) # tweaks->Compiz self.window.select_target_feature('tweaks') self.assertEqual(self.window.current_feature, 'tweaks') self.assertEqual(self.window.navigation_dict, {'tweaks': ('Compiz', None), 'admins': (None, 'DesktopRecovery')}) def tearDown(self): del self.window
def setUp(self): self.window = UbuntuTweakWindow() self.window.loaded_modules = {} self.window.modules_index = {} self.window.navigation_dict = {'tweaks': [None, None]} self.setting = GSetting('com.ubuntu-tweak.tweak.recently-used')