# Path: ddsc/ddsclient.py
# NO_PROJECTS_FOUND_MESSAGE = 'No projects found.'


import unittest
import subprocess
import shutil
import hashlib
import os
from ddsc.ddsclient import NO_PROJECTS_FOUND_MESSAGE


def ddsclient_cmd(str_args):
    return subprocess.check_output(["bash", "-c", "ddsclient {}".format(str_args)]).decode("utf-8")


def diff_items(item1, item2):
    return subprocess.check_output(["bash", "-c", "diff -r {} {}".format(item1, item2)])


def hash_file(filename):
    hash = hashlib.sha256()
    with open(filename, "rb") as f:
        for chunk in iter(lambda: f.read(2048), b""):
            hash.update(chunk)
    return hash.hexdigest()



# Path: ddsc/ddsclient.py
# NO_PROJECTS_FOUND_MESSAGE = 'No projects found.'


# Path: test_scripts/tests/test_commands.py
import unittest
import subprocess
import shutil
import hashlib
import os
from ddsc.ddsclient import NO_PROJECTS_FOUND_MESSAGE



def ddsclient_cmd(str_args):
    return subprocess.check_output(["bash", "-c", "ddsclient {}".format(str_args)]).decode("utf-8")


def diff_items(item1, item2):
    return subprocess.check_output(["bash", "-c", "diff -r {} {}".format(item1, item2)])


def hash_file(filename):
    hash = hashlib.sha256()
    with open(filename, "rb") as f:
        for chunk in iter(lambda: f.read(2048), b""):
            hash.update(chunk)
    return hash.hexdigest()



@unittest.skipIf(os.environ.get('INTEGRATION_TESTS') != "Y", "skipping integration tests")