コード例 #1
0
ファイル: test_settings.py プロジェクト: Berimor66/mythbox
 def test_saveSettings_LoadedDefaultsCreatesNewSettingsFile(self):
     filename = "settings.xml"
     filepath = os.path.join(self.sandbox, filename)
     when(self.platform).getScriptDataDir().thenReturn(self.sandbox)
     self.assertFalse(os.path.exists(filepath))
     s = MythSettings(self.platform, self.translator)
     s.save()
     self.assertTrue(os.path.exists(filepath))
コード例 #2
0
ファイル: test_settings.py プロジェクト: bopopescu/mythbox-1
 def test_saveSettings_LoadedDefaultsCreatesNewSettingsFile(self):
     filename = 'settings.xml'
     filepath = os.path.join(self.sandbox, filename)
     when(self.platform).getScriptDataDir().thenReturn(self.sandbox)
     self.assertFalse(os.path.exists(filepath))
     s = MythSettings(self.platform, self.translator)
     s.save()
     self.assertTrue(os.path.exists(filepath))
コード例 #3
0
ファイル: test_settings.py プロジェクト: Berimor66/mythbox
    def test_When_setting_has_a_unicode_value_Then_saving_and_loading_should_still_work(self):
        when(self.platform).getScriptDataDir().thenReturn(self.sandbox)
        s = MythSettings(self.platform, self.translator)
        unicodeStr = u"Königreich der Himmel"
        s.put("recordings_selected_group", unicodeStr)
        s.save()

        s2 = MythSettings(self.platform, self.translator)
        actualStr = s2.get("recordings_selected_group")
        self.assertTrue(unicodeStr == actualStr)
        self.assertTrue(isinstance(unicodeStr, unicode))
コード例 #4
0
ファイル: test_settings.py プロジェクト: bopopescu/mythbox-1
    def test_When_setting_has_a_unicode_value_Then_saving_and_loading_should_still_work(
            self):
        when(self.platform).getScriptDataDir().thenReturn(self.sandbox)
        s = MythSettings(self.platform, self.translator)
        unicodeStr = u'Königreich der Himmel'
        s.put('recordings_selected_group', unicodeStr)
        s.save()

        s2 = MythSettings(self.platform, self.translator)
        actualStr = s2.get('recordings_selected_group')
        self.assertTrue(unicodeStr == actualStr)
        self.assertTrue(isinstance(unicodeStr, unicode))