@defer.inlineCallbacks
    def test_connect_event_called(self):
        """ Check that the right events are called when connections
        are established and lost. """
        engine_manager = self.make_engine_manager()

        engine_manager.engine = mocked_engine = self.mocker.engine
        mocked_connection = self.mocker.connection
        mocked_engine.connect.return_value=mocked_connection

        engine_manager.startService()

        event = yield self.events.get()
        self.assertEquals(event, ('connected', mocked_engine))

        engine_manager.stopService()
        yield util.wait(0)

        self.failIf(0 > self.events.size)

        self.assertEquals(self.mocker.mock_calls, [
                mock.call.engine.connect(),
                mock.call.connection.execute("SELECT 'ping'"),
                mock.call.connection.close(),
                mock.call.engine.dispose()
        ])
dataset/ETHPy150Open foundit/Piped/contrib/database/piped_database/test/test_database.py/EngineProviderTest.test_connect_event_called/swapped operands of `>`