@defer.inlineCallbacks
    def test_valid_login(self):
        self.runtime_environment.configure()
        cm = self.runtime_environment.configuration_manager
        dm = self.runtime_environment.dependency_manager

        self.create_pb_server(checker=dict(
            name = 'twisted.cred.checkers.InMemoryUsernamePasswordDatabaseDontUse',
            arguments = dict(test_username='test_password')
        ))

        cm.set('pb.clients.test_client', dict(
            endpoint = self.port%'tcp:host=localhost:port=%i',
            username = 'test_username',
            password = 'test_password'
        ))

        cm.set('pipelines.test_pipeline', [{'eval-lambda': {'lambda': 'baton: baton["deferred"].callback("logged in as %s"%baton["avatar_id"])'}}])
        pp = pipeline_provider.PipelineProvider()
        pp.configure(self.runtime_environment)

        self.application.startService()
        self.addCleanup(self.application.stopService)

        client_provider = spread_provider.PBClientProvider()
        client_provider.configure(self.runtime_environment)

        client_root_dependency = dm.add_dependency(self, dict(provider='pb.client.test_client.root_object'))
        dm.resolve_initial_states()

        root = yield client_root_dependency.wait_for_resource()
        result = yield root.callRemote('any')
        self.assertEquals(result, 'logged in as test_username')
dataset/ETHPy150Open foundit/Piped/piped/providers/test/test_spread_provider.py/PBClientTest.test_valid_login/swapped operands of `%`