def upload(self): puts('*** Uploading %s' % (self.local_path)) puts('*** To %s' % (self.remote_path)) upload = inviqa_confirm('>>> Continue?') with cd(self.remote_cd_path): if upload: put(self.local_path, self.remote_path)
def download(self): puts('*** Downloading from %s' % (self.remote_path)) puts('*** To %s' % (self.local_path)) download = inviqa_confirm('>>> Continue?') with cd(self.remote_cd_path): if download: get(self.remote_path, self.local_path)
def run(self): """ Runs behat selected features in specified path. """ if self.path == False: puts("!!! Cannot list 'features' from specified path.") return 1 profile = prompt('>>> Enter Behat profile or press enter to run default profile') options = prompt('>>> Enter any additional options for behat command or press enter') if re.match(r'^\d{1,}-\d{1,}', self.selected): range_split = self.selected.split('-') selected_list = range(int(range_split[0]), int(range_split[1])) else: selected_list = self.selected.split(' ') for selected in selected_list: selected = str(selected); if selected.isdigit(): findex = int(selected.strip()) -1 if selected.isdigit() == False: run_feature = '' else: run_feature = self.features_list[findex] line = prompt('>>> Enter line number, or press enter') if line: run_feature = run_feature + ':' + line if run_feature != '': puts("*** Running feature: " + run_feature) else: puts("*** Running all features in suite") behat_command = "bin/behat features/%s %s" % (run_feature, options) if (profile): behat_command = "bin/behat -p %s features/%s %s" % (profile, run_feature, options) local(behat_command)
def notify(self, environment): puts("!! Running task on %s.\nCurrent Working directory: %s" % (env.hosts[0], environment.www_home_dir()))
def remote_task_notifier(self): puts("*** Running task on %s" % env.hosts[0])