# Path: invtool/tests/utils.py
# def call_to_json(command_str):
#     """
#     Given a string, this function will shell out, execute the command
#     and parse the json returned by that command
#     """
#     print command_str
#     p = subprocess.Popen(shlex.split(command_str),
#                          stderr=subprocess.PIPE, stdout=subprocess.PIPE)
#     stdout, stderr = p.communicate()
#     if stderr:
#         return None, stderr, p.returncode
# 
#     stdout = stdout.replace('u\'', '"').replace('\'', '"').strip('\n')
#     try:
#         return json.loads(stdout, 'unicode'), None, p.returncode
#     except json.decoder.JSONDecodeError, e:
#         return (None,
#                 "Ret was: {0}. Got error: {1}".format(stdout, str(e)),
#                 p.returncode)
# 
# EXEC = "./inv --json"


import unittest
    import simplejson as json
    import json
from invtool.tests.utils import call_to_json, EXEC

try:
except ImportError:



def run_tests():
    def build_testcase(commands):
        """The first command is used to create an object. Using the pk returned
        from the object's creation we look up the object and use the second
        command to update the object. The object is then deleted and finally
        the object is looked up again to ensure a 404."""
        class _TestCase(unittest.TestCase):
            pass

        def place_holder(self):
            # Search
            def test_search():
                expected_status, command = commands[0]

# Path: invtool/tests/utils.py
# def call_to_json(command_str):
#     """
#     Given a string, this function will shell out, execute the command
#     and parse the json returned by that command
#     """
#     print command_str
#     p = subprocess.Popen(shlex.split(command_str),
#                          stderr=subprocess.PIPE, stdout=subprocess.PIPE)
#     stdout, stderr = p.communicate()
#     if stderr:
#         return None, stderr, p.returncode
# 
#     stdout = stdout.replace('u\'', '"').replace('\'', '"').strip('\n')
#     try:
#         return json.loads(stdout, 'unicode'), None, p.returncode
#     except json.decoder.JSONDecodeError, e:
#         return (None,
#                 "Ret was: {0}. Got error: {1}".format(stdout, str(e)),
#                 p.returncode)
# 
# EXEC = "./inv --json"


# Path: invtool/tests/search_tests.py
import unittest
    import simplejson as json
    import json
from invtool.tests.utils import call_to_json, EXEC


try:
except ImportError:



def run_tests():
    def build_testcase(commands):
        """The first command is used to create an object. Using the pk returned
        from the object's creation we look up the object and use the second
        command to update the object. The object is then deleted and finally
        the object is looked up again to ensure a 404."""
        class _TestCase(unittest.TestCase):
            pass

        def place_holder(self):
            # Search
            def test_search():
                expected_status, command = commands[0]

                ret, errors, rc = call_to_json(command)