def setUp(self): """ If it's a development environment, set up the client and deploy test services + objects. """ self.should_run = False # Run the tests only if it's a development box if os.path.exists(DEV_CONFIG_FILE): config = ConfigObj(DEV_CONFIG_FILE) server_fs_loc = os.path.expanduser( config['server1']['fs_location']) pickup_dir = os.path.join(server_fs_loc, 'pickup-dir') self.util = Util(server_fs_loc) self.util.set_zato_client() test_pattern = os.path.join(os.path.dirname(__file__), 'zato_test_live_*') for item in glob.glob(test_pattern): shutil.copy(item, pickup_dir) # Needed because uploading a package is asynchronous so we don't want to run the tests # until the package is ready. time.sleep(0.2) self.should_run = True
def setUp(self): """ If it's a development environment, set up the client and deploy test services + objects. """ self.should_run = False # Run the tests only if it's a development box if os.path.exists(DEV_CONFIG_FILE): config = ConfigObj(DEV_CONFIG_FILE) server_fs_loc = os.path.expanduser( config['server1']['fs_location']) pickup_dir = os.path.join(server_fs_loc, 'pickup-dir') self.util = Util(server_fs_loc) self.util.set_zato_client() test_pattern = os.path.join(os.path.dirname(__file__), self.SERVICES_SOURCE) for item in glob.glob(test_pattern): shutil.copy(item, pickup_dir) # Needed because uploading a package is asynchronous so we don't want to run the tests # until the package is ready. # TODO: do not wait a fixed amount of time but rather check (every second?) if the service has already been already deployed time.sleep(1) self.should_run = True