Esempio n. 1
0
 def test_shell_bootstrap(self):
     options = mock.Mock()
     bootstrap = ShellBootstrap(options=options, initial=True)
     # This will fail since testsuit already setup it
     mocked = mock.patch.object(bootstrap, '_setup_gobject', new=lambda: None)
     mocked.start()
     try:
         bootstrap.bootstrap()
     finally:
         mocked.stop()
Esempio n. 2
0
 def test_shell_bootstrap(self):
     options = mock.Mock()
     bootstrap = ShellBootstrap(options=options, initial=True)
     # This will fail since testsuit already setup it
     mocked = mock.patch.object(bootstrap, '_setup_gobject', new=lambda: None)
     mocked.start()
     try:
         bootstrap.bootstrap()
     finally:
         mocked.stop()
Esempio n. 3
0
    def test_shell_bootstrap(self):
        options = mock.Mock()
        bootstrap = ShellBootstrap(options=options, initial=True)
        mocks = []
        for func in [
                # Those two fail as testsuit already setup them
                '_setup_gobject',
                '_setup_twisted']:
            mocked = mock.patch.object(bootstrap, func, new=lambda: None)
            mocks.append(mocked)
            mocked.start()

        try:
            bootstrap.bootstrap()
        finally:
            for mocked in mocks:
                mocked.stop()
Esempio n. 4
0
    def testShellBootstrap(self):
        options = mock.Mock()
        bootstrap = ShellBootstrap(options=options, initial=True)
        mocks = []
        for func in [
                # Those two fail as testsuit already setup them
                '_setup_gobject',
                '_setup_twisted'
        ]:
            mocked = mock.patch.object(bootstrap, func, new=lambda: None)
            mocks.append(mocked)
            mocked.start()

        try:
            bootstrap.bootstrap()
        finally:
            for mocked in mocks:
                mocked.stop()
Esempio n. 5
0
    def test_shell_bootstrap(self):
        options = mock.Mock()
        bootstrap = ShellBootstrap(options=options, initial=True)
        mocks = []
        # This will fail since testsuit already setup it
        mocks.append(
            mock.patch.object(bootstrap, '_setup_gobject', new=lambda: None))
        # This will change the locale of all the tests that come after it,
        # making a lot of them fail
        mocks.append(
            mock.patch.object(bootstrap, '_set_user_locale', new=lambda: None))

        for mocked in mocks:
            mocked.start()

        try:
            bootstrap.bootstrap()
        finally:
            for mocked in mocks:
                mocked.stop()
Esempio n. 6
0
    def test_shell_bootstrap(self):
        options = mock.Mock()
        bootstrap = ShellBootstrap(options=options, initial=True)
        mocks = []
        # This will fail since testsuit already setup it
        mocks.append(
            mock.patch.object(bootstrap, '_setup_gobject', new=lambda: None))
        # This will change the locale of all the tests that come after it,
        # making a lot of them fail
        mocks.append(
            mock.patch.object(bootstrap, '_set_user_locale', new=lambda: None))

        for mocked in mocks:
            mocked.start()

        try:
            bootstrap.bootstrap()
        finally:
            for mocked in mocks:
                mocked.stop()