def test_tor_connection_user_data_dir(self):

        config = TorConfig()
        config.OrPort = 1234

        class Connector:
            def __call__(self, proto, trans):
                proto._set_valid_events('STATUS_CLIENT')
                proto.makeConnection(trans)
                proto.post_bootstrap.callback(proto)
                return proto.post_bootstrap

        def on_protocol(proto):
            proto.outReceived('Bootstrapped 90%\n')

        my_dir = tempfile.mkdtemp(prefix='tortmp')
        config.DataDirectory = my_dir
        trans = FakeProcessTransport()
        trans.protocol = self.protocol
        creator = functools.partial(Connector(), self.protocol, self.transport)
        d = launch_tor(
            config,
            FakeReactor(self, trans, on_protocol),
            connection_creator=creator,
            tor_binary='/bin/echo'
        )

        def still_have_data_dir(proto, tester):
            proto.cleanup()  # FIXME? not really unit-testy as this is sort of internal function
            tester.assertTrue(os.path.exists(my_dir))
            delete_file_or_tree(my_dir)

        d.addCallback(still_have_data_dir, self)
        d.addErrback(self.fail)
        return d
Binary Crossentropy.
dataset/ETHPy150Open meejah/txtorcon/test/test_torconfig.py/LaunchTorTests.test_tor_connection_user_data_dir--crossover with--dataset/ETHPy150Open tflearn/tflearn/tflearn/objectives.py/binary_crossentropy