# Path: multiscanner/common/utils.py
#     SSH = True
#     SSH = False
# def load_module(name, path):
# def list2cmdline(list):
# def convert_encoding(data, encoding='UTF-8', errors='replace'):
# def parse_config(config_object):
# def get_config_path(config_file, component):
# def dirname(path):
# def basename(path):
# def parseDir(directory, recursive=False, exclude=['__init__']):
# def parseFileList(FileList, recursive=False):
# def chunk_file_list(filelist, cmdlength=7191):
# def queue2list(queue):
# def hashfile(fname, hasher, blocksize=65536):
# def sshconnect(hostname, port=22, username=None, password=None, pkey=None,
#                key_filename=None, timeout=None, allow_agent=True,
#                look_for_keys=True, compress=False, sock=None):
# def sessionexec(client, cmd):
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):


import os
from multiscanner.common import utils
MS_WD = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))



def test_list2cmdline():
    ls = ['1', 'a', '"dsafsad"']
    result = '1 a "dsafsad"'
    assert utils.list2cmdline(ls) == result


def test_dirname_linux_file():
    linux_file = '/a/b/c/d.txt'

# Path: multiscanner/common/utils.py
#     SSH = True
#     SSH = False
# def load_module(name, path):
# def list2cmdline(list):
# def convert_encoding(data, encoding='UTF-8', errors='replace'):
# def parse_config(config_object):
# def get_config_path(config_file, component):
# def dirname(path):
# def basename(path):
# def parseDir(directory, recursive=False, exclude=['__init__']):
# def parseFileList(FileList, recursive=False):
# def chunk_file_list(filelist, cmdlength=7191):
# def queue2list(queue):
# def hashfile(fname, hasher, blocksize=65536):
# def sshconnect(hostname, port=22, username=None, password=None, pkey=None,
#                key_filename=None, timeout=None, allow_agent=True,
#                look_for_keys=True, compress=False, sock=None):
# def sessionexec(client, cmd):
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):


# Path: multiscanner/tests/test_common_lib.py
import os
from multiscanner.common import utils

MS_WD = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))



def test_list2cmdline():
    ls = ['1', 'a', '"dsafsad"']
    result = '1 a "dsafsad"'
    assert utils.list2cmdline(ls) == result


def test_dirname_linux_file():
    linux_file = '/a/b/c/d.txt'

    result = utils.dirname(linux_file)