예제 #1
0
def test_function_name_logged():
    lode.log('logging function name')

    with open(LODEFILE) as f:
        function_found = False
        for line in f:
            if 'test_function_name_logged' in line:
                function_found = True
    assert (function_found)
예제 #2
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_things_are_logged_with_sep():
    things = ('one', 'two', 'three', 'four')
    sep = ':'
    things_str = sep.join(things)

    lode.log(*things, sep=sep)

    with open(LODEFILE) as f:
        assert(things_str in f.read())
예제 #3
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_function_name_logged():
    lode.log('logging function name')

    with open(LODEFILE) as f:
        function_found = False
        for line in f:
            if 'test_function_name_logged' in line:
                function_found = True
    assert(function_found)
예제 #4
0
def test_things_are_logged_with_sep():
    things = ('one', 'two', 'three', 'four')
    sep = ':'
    things_str = sep.join(things)

    lode.log(*things, sep=sep)

    with open(LODEFILE) as f:
        assert (things_str in f.read())
예제 #5
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_thing_is_logged():
    thing = 'thing with some different words'

    lode.log(thing)

    with open(LODEFILE) as f:
        thing_found = False
        for line in f:
            if thing in line:
                thing_found = True

    assert(thing_found)
예제 #6
0
def test_thing_is_logged():
    thing = 'thing with some different words'

    lode.log(thing)

    with open(LODEFILE) as f:
        thing_found = False
        for line in f:
            if thing in line:
                thing_found = True

    assert (thing_found)
예제 #7
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_thing_is_logged_to_different_file():
    thing = 'thing with some different words'
    filename = '/tmp/new_lodefile'
    with open(filename, 'a') as f:
        lode.log(thing, file=f)

    with open(filename) as f:
        thing_found = False
        for line in f:
            if thing in line:
                thing_found = True

    assert(thing_found)
예제 #8
0
def test_five_things_are_logged():
    things = ('one', 'two', 'three', 'four')
    things_str = ' '.join(things)

    lode.log(*things)

    with open(LODEFILE) as f:
        things_found = False
        for line in f:
            if things_str in line:
                things_found = True

    assert (things_found)
예제 #9
0
def test_thing_is_logged_to_different_file():
    thing = 'thing with some different words'
    filename = '/tmp/new_lodefile'
    with open(filename, 'a') as f:
        lode.log(thing, file=f)

    with open(filename) as f:
        thing_found = False
        for line in f:
            if thing in line:
                thing_found = True

    assert (thing_found)
예제 #10
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_five_things_are_logged():
    things = ('one', 'two', 'three', 'four')
    things_str = ' '.join(things)

    lode.log(*things)

    with open(LODEFILE) as f:
        things_found = False
        for line in f:
            if things_str in line:
                things_found = True

    assert(things_found)
예제 #11
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_log_file_created():
    lode.log('created file')
    assert(os.path.isfile(LODEFILE))
예제 #12
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_log_function_exists():
    assert(lode.log('hello') is None)
예제 #13
0
파일: test_lode.py 프로젝트: kragniz/lode
 def c():
     lode.log('this has a traceback attached', traceback=5)
예제 #14
0
파일: test_lode.py 프로젝트: kragniz/lode
 def nested(self):
     lode.log('deep function', qualify=True)
예제 #15
0
def test_log_function_exists():
    assert (lode.log('hello') is None)
예제 #16
0
파일: test_lode.py 프로젝트: kragniz/lode
def test_setting_filename():
    name = 'different_lodefile'
    lode.log('hi there', name=name)
    with open(name) as f:
        assert('hi there' in f.read())
예제 #17
0
def test_setting_filename():
    name = 'different_lodefile'
    lode.log('hi there', name=name)
    with open(name) as f:
        assert ('hi there' in f.read())
예제 #18
0
def test_log_file_created():
    lode.log('created file')
    assert (os.path.isfile(LODEFILE))
예제 #19
0
 def nested(self):
     lode.log('deep function', qualify=True)
예제 #20
0
 def c():
     lode.log('this has a traceback attached', traceback=5)
예제 #21
0
파일: test_lode.py 프로젝트: kragniz/lode
 def f1():
     lode.log('caller depth=3', depth=3)
예제 #22
0
 def f1():
     lode.log('caller depth=3', depth=3)