當前位置: 首頁>>代碼示例>>Python>>正文


Python profile.ProfileManager類代碼示例

本文整理匯總了Python中freeseer.framework.config.profile.ProfileManager的典型用法代碼示例。如果您正苦於以下問題:Python ProfileManager類的具體用法?Python ProfileManager怎麽用?Python ProfileManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ProfileManager類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: recording

    def recording(self, request, test_client, monkeypatch, tmpdir):

        recording = server.app.blueprints['recording']

        monkeypatch.setattr(settings, 'configdir', str(tmpdir.mkdir('configdir')))
        test_client.get('/recordings')

        profile_manager = ProfileManager(str(tmpdir.mkdir('profile')))
        recording.profile = profile_manager.get('testing')
        recording.config = recording.profile.get_config('freeseer.conf', settings.FreeseerConfig, ['Global'], read_only=True)
        recording.config.videodir = str(tmpdir.mkdir('Videos'))
        recording.plugin_manager = PluginManager(recording.profile)

        return recording
開發者ID:Blakstar26,項目名稱:freeseer,代碼行數:14,代碼來源:test_server.py

示例2: TestReportEditorApp

class TestReportEditorApp(unittest.TestCase):
    '''
    Test cases for ReportEditorApp.
    '''

    def setUp(self):
        '''
        Stardard init method: runs before each test_* method

        Initializes a QtGui.QApplication and ReportEditorApp object.
        ReportEditorApp() causes the UI to be rendered.
        '''
        self.profile_manager = ProfileManager(tempfile.mkdtemp())
        profile = self.profile_manager.get('testing')
        config = profile.get_config('freeseer.conf', settings.FreeseerConfig, storage_args=['Global'], read_only=False)
        db = profile.get_database()

        self.app = QtGui.QApplication([])
        self.report_editor = ReportEditorApp(config, db)
        self.report_editor.show()

    def tearDown(self):
        shutil.rmtree(self.profile_manager._base_folder)
        del self.app
        del self.report_editor.app

    def test_close_report_editor(self):
        '''
        Tests closing the ReportEditorApp
        '''

        QtTest.QTest.mouseClick(self.report_editor.editorWidget.closeButton, Qt.Qt.LeftButton)
        self.assertFalse(self.report_editor.editorWidget.isVisible())

    def test_file_menu_quit(self):
        '''
        Tests ReportEditorApp's File->Quit
        '''

        self.assertTrue(self.report_editor.isVisible())

        # File->Menu
        self.report_editor.actionExit.trigger()
        self.assertFalse(self.report_editor.isVisible())

    def test_help_menu_about(self):
        '''
        Tests ReportEditorApp's Help->About
        '''

        self.assertTrue(self.report_editor.isVisible())

        # Help->About
        self.report_editor.actionAbout.trigger()
        self.assertFalse(self.report_editor.hasFocus())
        self.assertTrue(self.report_editor.aboutDialog.isVisible())

        # Click "Close"
        QtTest.QTest.mouseClick(self.report_editor.aboutDialog.closeButton, Qt.Qt.LeftButton)
        self.assertFalse(self.report_editor.aboutDialog.isVisible())
開發者ID:chungsharo,項目名稱:freeseer,代碼行數:60,代碼來源:test_reporteditor.py

示例3: setUp

    def setUp(self):
        '''
        Stardard init method: runs before each test_* method
        '''
        server.app.config['TESTING'] = True
        server.app.storage_file_path = "test_storage_file"
        self.app = server.app.test_client()
        self.recording = server.app.blueprints['recording']

        # token call to fire configuration logic
        self.app.get('/recordings')
        print self.recording.record_config.videodir

        self.profile_manager = ProfileManager(tempfile.mkdtemp())
        self.temp_video_dir = tempfile.mkdtemp()
        self.recording.record_config.videodir = self.temp_video_dir
        self.recording.record_profile = self.profile_manager.get('testing')
        self.recording.record_config = self.recording.record_profile.get_config('freeseer.conf', settings.FreeseerConfig, ['Global'], read_only=True)
        self.recording.record_plugin_manager = PluginManager(self.recording.record_profile)
        self.recording.media_dict = {}

        # mock media
        self.mock_media_1 = MockMedia()
        self.mock_media_2 = MockMedia()

        self.test_media_dict_1 = {}
        filepath1 = os.path.join(self.recording.record_config.videodir, 'mock_media_1')
        filepath2 = os.path.join(self.recording.record_config.videodir, 'mock_media_1')
        self.test_media_dict_1[1] = {'media': self.mock_media_1, 'filename': 'mock_media_1', 'filepath': filepath1}
        self.test_media_dict_1[2] = {'media': self.mock_media_2, 'filename': 'mock_media_2', 'filepath': filepath2}
開發者ID:bossjones,項目名稱:freeseer,代碼行數:30,代碼來源:test_server.py

示例4: TestConfig

class TestConfig(unittest.TestCase):

    def setUp(self):
        '''
        Stardard init method: runs before each test_* method

        Initializes a PluginManager

        '''
        self.profile_manager = ProfileManager(tempfile.mkdtemp())
        self.profile = self.profile_manager.get('testing')
        self.config = self.profile.get_config('freeseer.conf',
                                              settings.FreeseerConfig,
                                              ['Global'],
                                              read_only=False)

    def tearDown(self):
        '''
        Generic unittest.TestCase.tearDown()
        '''
        shutil.rmtree(self.profile_manager._base_folder)

    def test_save(self):
        '''
        Tests that the config file was created after being saved.
        '''
        filepath = self.profile.get_filepath('freeseer.conf')
        self.config.save()
        self.assertTrue(os.path.exists(filepath))
開發者ID:LCdevelop,項目名稱:freeseer,代碼行數:29,代碼來源:test_config.py

示例5: setUp

 def setUp(self):
     self.profile_manager = ProfileManager(tempfile.mkdtemp())
     self.temp_video_dir = tempfile.mkdtemp()
     profile = self.profile_manager.get('testing')
     config = profile.get_config('freeseer.conf', settings.FreeseerConfig, ['Global'], read_only=True)
     config.videodir = self.temp_video_dir
     plugin_manager = PluginManager(profile)
     self.multimedia = Multimedia(config, plugin_manager)
開發者ID:LCdevelop,項目名稱:freeseer,代碼行數:8,代碼來源:test_multimedia.py

示例6: setUp

    def setUp(self):
        '''
        Stardard init method: runs before each test_* method

        Initializes a PluginManager

        '''
        self.profile_manager = ProfileManager(tempfile.mkdtemp())
        profile = self.profile_manager.get('testing')
        self.plugman = PluginManager(profile)
開發者ID:Noodle1550,項目名稱:freeseer,代碼行數:10,代碼來源:test_plugins.py


注:本文中的freeseer.framework.config.profile.ProfileManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。