# Path: kibitzr/transformer/plain_text.py
# def python_transform(code, content, conf):
#     logger.info("Python transform")
#     logger.debug(code)
#     assert 'content' in code, PYTHON_ERROR
#     try:
#         namespace = {'ok': True, 'content': content}
#         context = {
#             'conf': conf,
#             'stash': LazyStash(),
#             'creds': settings().creds,
#         }
#         exec(code, context, namespace)
#         return namespace['ok'], six.text_type(namespace['content'])
#     except:
#         logger.exception("Python transform raised an Exception")
#         return False, traceback.format_exc()
# 
# def bash_transform(code, content):
#     return execute_bash(code, content)


from kibitzr.transformer.plain_text import (
    python_transform,
    bash_transform,
)


def test_bash_transform_sample():
    ok, content = bash_transform(
        code="sed 's/A/B/g'",
        content="ACTGA",
    )
    assert ok is True
    assert content.strip() == "BCTGB"


def test_python_transform_sample():

# Path: kibitzr/transformer/plain_text.py
# def python_transform(code, content, conf):
#     logger.info("Python transform")
#     logger.debug(code)
#     assert 'content' in code, PYTHON_ERROR
#     try:
#         namespace = {'ok': True, 'content': content}
#         context = {
#             'conf': conf,
#             'stash': LazyStash(),
#             'creds': settings().creds,
#         }
#         exec(code, context, namespace)
#         return namespace['ok'], six.text_type(namespace['content'])
#     except:
#         logger.exception("Python transform raised an Exception")
#         return False, traceback.format_exc()
# 
# def bash_transform(code, content):
#     return execute_bash(code, content)


# Path: tests/unit/transforms/test_script.py
from kibitzr.transformer.plain_text import (
    python_transform,
    bash_transform,
)



def test_bash_transform_sample():
    ok, content = bash_transform(
        code="sed 's/A/B/g'",
        content="ACTGA",
    )
    assert ok is True
    assert content.strip() == "BCTGB"


def test_python_transform_sample():

    ok, content = python_transform(