# Path: elodie/constants.py

# 
# Path: elodie/log.py
# def all(message):
# def info(message):
# def info_json(payload):
# def progress(message='.', new_line=False):
# def warn(message):
# def warn_json(payload):
# def error(message):
# def error_json(payload):
# def _print_debug(string):
# def _print(s):


import os
import sys
import unittest 
from json import dumps
from mock import patch
    from StringIO import StringIO
    from io import StringIO
from elodie import constants
from elodie import log


try:
except ImportError:

sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))))



def call_log_and_assert(func, args, expected):
    saved_stdout = sys.stdout
    try:
        out = StringIO()
        sys.stdout = out
        func(*args)
        output = out.getvalue()
        assert output == expected, (expected, func, output)
    finally:
        sys.stdout = saved_stdout

def with_new_line(string):
    return "{}\n".format(string)

@patch('elodie.log')
@patch('elodie.constants.debug', True)
def test_calls_print_debug_true(fake_log):
    expected = 'some string'
    fake_log.info.return_value = expected
    fake_log.warn.return_value = expected
    fake_log.error.return_value = expected

# Path: elodie/constants.py

# 
# Path: elodie/log.py
# def all(message):
# def info(message):
# def info_json(payload):
# def progress(message='.', new_line=False):
# def warn(message):
# def warn_json(payload):
# def error(message):
# def error_json(payload):
# def _print_debug(string):
# def _print(s):


# Path: elodie/tests/log_test.py
import os
import sys
import unittest 
from json import dumps
from mock import patch
    from StringIO import StringIO
    from io import StringIO
from elodie import constants
from elodie import log



try:
except ImportError:

sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))))



def call_log_and_assert(func, args, expected):
    saved_stdout = sys.stdout
    try:
        out = StringIO()
        sys.stdout = out
        func(*args)
        output = out.getvalue()
        assert output == expected, (expected, func, output)
    finally:
        sys.stdout = saved_stdout

def with_new_line(string):
    return "{}\n".format(string)

@patch('elodie.log')
@patch('elodie.constants.debug', True)
def test_calls_print_debug_true(fake_log):
    expected = 'some string'
    fake_log.info.return_value = expected
    fake_log.warn.return_value = expected
    fake_log.error.return_value = expected

    for func in [log.info, log.warn, log.error]: