From 57a3fc2a06fc3078f1f91cd8620eae5f2d9fb361 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 16 Jun 2009 22:19:05 +0000 Subject: [PATCH] Split rsync initialization out of run so we can test it better. (needed to support the previous changes to test/test_copier.py --- htsworkflow/automation/copier.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/htsworkflow/automation/copier.py b/htsworkflow/automation/copier.py index 785691e..9ec1e2b 100644 --- a/htsworkflow/automation/copier.py +++ b/htsworkflow/automation/copier.py @@ -170,7 +170,18 @@ class CopierBot(rpc.XmlRpcBot): self.register_function(self.startCopy) self.register_function(self.sequencingFinished) self.eventTasks.append(self.update) - + + def _init_rsync(self): + """ + Initalize rsync class + + This is only accessible for test purposes. + """ + # we can't call any logging function until after start finishes. + # this got moved to a seperate function from run to help with test code + if self.rsync is None: + self.rsync = rsync(self.sources, self.destination, self.password) + def read_config(self, section=None, configfile=None): """ read the config file @@ -195,9 +206,7 @@ class CopierBot(rpc.XmlRpcBot): """ Start application """ - # we can't call any logging function until after start finishes. - if self.rsync is None: - self.rsync = rsync(self.sources, self.destination, self.password) + self._init_rsync() super(CopierBot, self).run() def startCopy(self, *args): -- 2.30.2