forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestLog.py
More file actions
33 lines (26 loc) · 948 Bytes
/
Copy pathtestLog.py
File metadata and controls
33 lines (26 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
from nose.tools import *
from pyAvTranscoder import avtranscoder as av
def _logMessages(logger):
"""
Local function to log several messages.
"""
logger.log(av.AV_LOG_DEBUG, 'This is a debug message!')
logger.log(av.AV_LOG_INFO, 'This is an info message!')
logger.log(av.AV_LOG_WARNING, 'This is a warning message!')
logger.log(av.AV_LOG_ERROR, 'This is an error message!')
def testLogInFile():
"""
Check the behavior of the logger file.
"""
logger = av.Logger()
# log several messages in the standard output
_logMessages(logger)
# redirect the output of the logging messages
logger.logInFile()
# the logger message should exist and be empty
assert_equals(os.stat(av.LOG_FILE).st_size, 0)
# log several messages in the logger file
_logMessages(logger)
# the logger message should exist and be filled
assert_greater(os.stat(av.LOG_FILE).st_size, 0)