コード例 #1
0
ファイル: test_advanced.py プロジェクト: Berimor66/mythbox
 def test_hasSetting_When_setting_exists_at_depth_gt_1_Then_returns_true(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     xml = """
     <advancedsettings>
         <loglevel>0</loglevel>
         <video>
             <usetimeseeking>true</usetimeseeking>
         </video>
     </advancedsettings>
     """
     s = AdvancedSettings(platform=p, init_with=xml)
     self.assertTrue(s.hasSetting('video/usetimeseeking'))
     self.assertFalse(s.hasSetting('video/usetimeseeking/crapola'))
     self.assertTrue(s.hasSetting('loglevel'))
     self.assertFalse(s.hasSetting('loglevel/crapola'))
     self.assertTrue(s.hasSetting('video'))
コード例 #2
0
ファイル: test_advanced.py プロジェクト: bopopescu/mythbox-1
 def test_hasSetting_When_setting_exists_at_depth_eq_1_Then_returns_true(
         self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     advanced = AdvancedSettings(
         platform=p,
         init_with=
         """<advancedsettings><loglevel>0</loglevel></advancedsettings>""")
     self.assertTrue(advanced.hasSetting('loglevel'))
コード例 #3
0
ファイル: test_advanced.py プロジェクト: bopopescu/mythbox-1
 def test_hasSetting_When_setting_exists_at_depth_gt_1_Then_returns_true(
         self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     xml = """
     <advancedsettings>
         <loglevel>0</loglevel>
         <video>
             <usetimeseeking>true</usetimeseeking>
         </video>
     </advancedsettings>
     """
     s = AdvancedSettings(platform=p, init_with=xml)
     self.assertTrue(s.hasSetting('video/usetimeseeking'))
     self.assertFalse(s.hasSetting('video/usetimeseeking/crapola'))
     self.assertTrue(s.hasSetting('loglevel'))
     self.assertFalse(s.hasSetting('loglevel/crapola'))
     self.assertTrue(s.hasSetting('video'))
コード例 #4
0
ファイル: test_advanced.py プロジェクト: Berimor66/mythbox
 def test_hasSetting_When_setting_exists_at_depth_eq_1_Then_returns_true(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     advanced = AdvancedSettings(platform=p, init_with="""<advancedsettings><loglevel>0</loglevel></advancedsettings>""")
     self.assertTrue(advanced.hasSetting('loglevel'))
コード例 #5
0
ファイル: test_advanced.py プロジェクト: Berimor66/mythbox
 def test_hasSetting_When_setting_does_not_exist_Then_returns_false(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     advanced = AdvancedSettings(platform=p)
     self.assertFalse(advanced.hasSetting('loglevel'))
コード例 #6
0
ファイル: test_advanced.py プロジェクト: Berimor66/mythbox
 def test_constructor_When_seeded_with_xml_as_string(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     xml = """<advancedsettings><loglevel>0</loglevel></advancedsettings>"""
     advanced = AdvancedSettings(platform=p, init_with=xml)
     self.assertTrue(advanced.hasSetting('loglevel'))
コード例 #7
0
ファイル: test_advanced.py プロジェクト: bopopescu/mythbox-1
 def test_hasSetting_When_setting_does_not_exist_Then_returns_false(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     advanced = AdvancedSettings(platform=p)
     self.assertFalse(advanced.hasSetting('loglevel'))
コード例 #8
0
ファイル: test_advanced.py プロジェクト: bopopescu/mythbox-1
 def test_constructor_When_seeded_with_xml_as_string(self):
     p = Mock()
     when(p).getUserDataDir().thenReturn('')
     xml = """<advancedsettings><loglevel>0</loglevel></advancedsettings>"""
     advanced = AdvancedSettings(platform=p, init_with=xml)
     self.assertTrue(advanced.hasSetting('loglevel'))