def generate_tmp_file(): """Generates temp file and pushes it to target""" global tmp_file if not tmp_file: tmp_file = tempfile.NamedTemporaryFile(delete=True) print('*** preparing temporary file with name ' + tmp_file.name) adb.push(tmp_file.name, DEST_FOLDER_TARGET) #gets full path on target for tmp_file global tmp_file_on_target tmp_file_on_target = (DEST_FOLDER_TARGET + os.path.basename(tmp_file.name)) print('*** getting path to tmp_file ' + str(tmp_file.name)) #gets path to dest_folder_host global tmp_file global dest_folder_host dest_folder_host = os.path.dirname(tmp_file.name) print('*** getting path to dest_folder_host ' + dest_folder_host)
def test_push_n_invalid_source_folder(self): global tmp_file result = adb.push(NON_EXISTING_DIR, DEST_FOLDER_TARGET) self.assertNotEqual(str(result), 0)
def test_push_p(self): global tmp_file global positive_exp_result_wo_output result = adb.push(tmp_file.name, DEST_FOLDER_TARGET) self.assertEqual(result, positive_exp_result_wo_output)
def test_push_invalid_source_folder(self): global tmp_file result = adb.push(NON_EXISTING_DIR, DEST_FOLDER_TARGET) self.assertNotEqual(str(result), 0)
def test_push(self): global tmp_file global POSITIVE_EXP_RESULT_WO_OUTPUT result = adb.push(tmp_file.name, DEST_FOLDER_TARGET) self.assertEqual(result, POSITIVE_EXP_RESULT_WO_OUTPUT)
def test_push_invalid_source_folder(self): result = adb.push(NON_EXISTING_DIR, DEST_FOLDER_TARGET) result[0].should_not.be(str(1))
def test_push(self): result = adb.push(tmp_file.name, DEST_FOLDER_TARGET) result.should.be(POSITIVE_EXP_RESULT_WO_OUTPUT)