コード例 #1
0
ファイル: test_main.py プロジェクト: tmaxter/stoq
    def setUp(self):
        self._mocks = []

        self._iappinfo = get_utility(IAppInfo)
        # Shell will provide this utility
        remove_utility(IAppInfo)

        # If the locale is changed here, gui tests will break
        mocked = mock.patch.dict(get_settings()._root, clear=True)
        self._mocks.append(mocked)

        # Do not show the splash screen during the tests
        mocked = mock.patch('stoqlib.gui.splash.show_splash', new=lambda: None)
        self._mocks.append(mocked)

        # If a dependency is missing, avoid showing an error message
        # or else jenkins will hang
        mocked = mock.patch('stoq.lib.dependencies.DependencyChecker._error',
                            new=lambda *args: None)
        self._mocks.append(mocked)

        for mocked in self._mocks:
            mocked.start()
コード例 #2
0
    def setUp(self):
        self._mocks = []

        self._iappinfo = get_utility(IAppInfo)
        # Shell will provide this utility
        remove_utility(IAppInfo)

        # If the locale is changed here, gui tests will break
        mocked = mock.patch.dict(get_settings()._root, clear=True)
        self._mocks.append(mocked)

        # Do not show the splash screen during the tests
        mocked = mock.patch('stoqlib.gui.widgets.splash.show_splash',
                            new=lambda: None)
        self._mocks.append(mocked)

        # If a dependency is missing, avoid showing an error message
        # or else jenkins will hang
        mocked = mock.patch('stoq.lib.dependencies.DependencyChecker._error',
                            new=lambda *args: None)
        self._mocks.append(mocked)

        for mocked in self._mocks:
            mocked.start()
コード例 #3
0
ファイル: test_component.py プロジェクト: gxela/kiwi-gtk
 def testRemove(self):
     self.assertRaises(NotImplementedError, remove_utility, IBanana)
     provide_utility(IBanana, o)
     self.assertEqual(remove_utility(IBanana), o)
     self.assertRaises(NotImplementedError, remove_utility, IBanana)
コード例 #4
0
 def testRemove(self):
     self.assertRaises(NotImplementedError, remove_utility, IBanana)
     provide_utility(IBanana, o)
     self.assertEqual(remove_utility(IBanana), o)
     self.assertRaises(NotImplementedError, remove_utility, IBanana)