def setUp(self):
        self.clock = task.Clock()
        self.clock.spawnProcess = Mock()
        treq_mock = create_autospec(treq)
        response_mock = Mock()
        response_mock.text.return_value = defer.succeed("")
        treq_mock.request.return_value = defer.succeed(response_mock)
        self.config = Config.default()
        self.config.path = "./"
        try:
            os.makedirs("clients/algo")
        except FileExistsError:
            pass
        self.remote = MinerStatRemoteProtocol(self.config, treq_mock)
        self.rig = Rig(self.config, remote=self.remote, reactor=self.clock)
        self.rig.start = Mock(return_value=defer.succeed(None))
        self.rig.stop = Mock(return_value=defer.succeed(None))
        self.service = MinerStatService(self.rig)