# Path: qa/shell.py
# def git(*command_parts, **kwargs):
#     return run_command("git", *command_parts, **kwargs)
# 
# def gitlint(*command_parts, **kwargs):
#     return run_command("gitlint", *command_parts, **kwargs)
# 
# class RunningCommand:
#     pass
# 
# Path: qa/utils.py
# DEFAULT_ENCODING = getpreferredencoding()


import io
import os
import platform
import shutil
import sys
import tempfile
import arrow
from datetime import datetime
from uuid import uuid4
from unittest import TestCase
from qa.shell import git, gitlint, RunningCommand
from qa.utils import DEFAULT_ENCODING




class BaseTestCase(TestCase):
    """ Base class of which all gitlint integration test classes are derived.
        Provides a number of convenience methods. """

    # In case of assert failures, print the full error message
    maxDiff = None
    tmp_git_repo = None

    GITLINT_USE_SH_LIB = os.environ.get("GITLINT_USE_SH_LIB", "[NOT SET]")
    GIT_CONTEXT_ERROR_CODE = 254
    GITLINT_USAGE_ERROR = 253

    def setUp(self):
        """ Sets up the integration tests by creating a new temporary git repository """
        self.tmpfiles = []
        self.tmp_git_repos = []
        self.tmp_git_repo = self.create_tmp_git_repo()

    def tearDown(self):
        # Clean up temporary files and repos
        for tmpfile in self.tmpfiles:
            os.remove(tmpfile)
        for repo in self.tmp_git_repos:
            shutil.rmtree(repo)

    def assertEqualStdout(self, output, expected):  # pylint: disable=invalid-name

# Path: qa/shell.py
# def git(*command_parts, **kwargs):
#     return run_command("git", *command_parts, **kwargs)
# 
# def gitlint(*command_parts, **kwargs):
#     return run_command("gitlint", *command_parts, **kwargs)
# 
# class RunningCommand:
#     pass
# 
# Path: qa/utils.py
# DEFAULT_ENCODING = getpreferredencoding()


# Path: qa/base.py
import io
import os
import platform
import shutil
import sys
import tempfile
import arrow
from datetime import datetime
from uuid import uuid4
from unittest import TestCase
from qa.shell import git, gitlint, RunningCommand
from qa.utils import DEFAULT_ENCODING





class BaseTestCase(TestCase):
    """ Base class of which all gitlint integration test classes are derived.
        Provides a number of convenience methods. """

    # In case of assert failures, print the full error message
    maxDiff = None
    tmp_git_repo = None

    GITLINT_USE_SH_LIB = os.environ.get("GITLINT_USE_SH_LIB", "[NOT SET]")
    GIT_CONTEXT_ERROR_CODE = 254
    GITLINT_USAGE_ERROR = 253

    def setUp(self):
        """ Sets up the integration tests by creating a new temporary git repository """
        self.tmpfiles = []
        self.tmp_git_repos = []
        self.tmp_git_repo = self.create_tmp_git_repo()

    def tearDown(self):
        # Clean up temporary files and repos
        for tmpfile in self.tmpfiles:
            os.remove(tmpfile)
        for repo in self.tmp_git_repos:
            shutil.rmtree(repo)

    def assertEqualStdout(self, output, expected):  # pylint: disable=invalid-name

        self.assertIsInstance(output, RunningCommand)