当前位置: 首页>>代码示例>>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;未经允许,请勿转载。