<commit_before>import unittest
import tempfile
import sys
import os
import ntpath
import adb

DEST_FOLDER_TARGET = '/data/media/0/'
NON_EXISTING_DIR = '/non-existing-dir/'
dest_folder_host = ''

ADB_COMMAND_PREFIX = 'adb'
ADB_COMMAND_SHELL = 'shell'
ADB_COMMAND_PULL = 'pull'
ADB_COMMAND_PUSH = 'push'
ADB_COMMAND_RM = 'rm -r'
ADB_COMMAND_CHMOD = 'chmod -R 777'
ADB_COMMAND_UNINSTALL = 'uninstall'
ADB_COMMAND_INSTALL = 'install'
ADB_COMMAND_FORWARD = 'forward'

tmp_file = None
tmp_file_on_target = None

adb_push = None
adb_pull = None

def setUpModule():
    #todo: implement tearDownModule function which will clean generated files
    #from device and host system
    generate_tmp_file()

def generate_tmp_file():
    """Generates temp file and pushes it to target"""
    global tmp_file
    if not tmp_file:
        tmp_file = tempfile.NamedTemporaryFile(delete=False)
        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 + ntpath.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)

class TestPushCommand(unittest.TestCase):
    def test_push_p(self):
        global tmp_file
        result = adb.push(tmp_file.name, DEST_FOLDER_TARGET)
        self.assertEqual(result, True)

    def test_push_n_invalid_1_parameter(self):
        global tmp_file
        result = adb.push(None,DEST_FOLDER_TARGET)<commit_msg>Activate tmp file deletion on host<commit_after>import unittest
import tempfile
import sys
import os
import ntpath
import adb

DEST_FOLDER_TARGET = '/data/media/0/'
NON_EXISTING_DIR = '/non-existing-dir/'
dest_folder_host = ''

ADB_COMMAND_PREFIX = 'adb'
ADB_COMMAND_SHELL = 'shell'
ADB_COMMAND_PULL = 'pull'
ADB_COMMAND_PUSH = 'push'
ADB_COMMAND_RM = 'rm -r'
ADB_COMMAND_CHMOD = 'chmod -R 777'
ADB_COMMAND_UNINSTALL = 'uninstall'
ADB_COMMAND_INSTALL = 'install'
ADB_COMMAND_FORWARD = 'forward'

tmp_file = None
tmp_file_on_target = None

adb_push = None
adb_pull = None

def setUpModule():
    #todo: implement tearDownModule function which will clean generated files
    #from device and host system
    generate_tmp_file()

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 + ntpath.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)

class TestPushCommand(unittest.TestCase):
    def test_push_p(self):
        global tmp_file
        result = adb.push(tmp_file.name, DEST_FOLDER_TARGET)
        self.assertEqual(result, True)

    def test_push_n_invalid_1_parameter(self):
        global tmp_file
        result = adb.push(None,DEST_FOLDER_TARGET)
{'fraction_non_alphanumeric': 0.08527572484366117, 'fraction_numerical': 0.0028425241614553724, 'mean_word_length': 4.267964071856287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '301439', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1219, 'n_words': 284}