Ejemplo n.º 1
0
def create_new_log_manager_add_warning_entry_test():
    try:
        log_man = LogManager('tests/')
        if log_man is not None:
            log_man.add_warning_entry_to_log('Test WARNING entry')
            success_item = 'create_new_log_manager_add_warning_entry_test'
            success_list.append(success_item)
        else:
            error_item = ['create_new_log_manager_add_warning_entry_test', 'Could not create LogManager object']
            error_list.append(error_item)
    except Exception, e:
        error_item = ['create_new_log_manager_add_warning_entry_test', str(e)]
        error_list.append(error_item)
Ejemplo n.º 2
0
def create_new_log_manager_get_oldest_log_file_name_test():
    try:
        log_man = LogManager('tests/')
        if log_man is not None:
            oldest_log_file_name = log_man.get_oldest_log_file_name()
            success_item = 'create_new_log_manager_get_oldest_log_file_name_test'
            success_list.append(success_item)
        else:
            error_item = ['create_new_log_manager_get_oldest_log_file_name_test', 'Could not create LogManager object']
            error_list.append(error_item)
    except Exception, e:
        error_item = ['create_new_log_manager_get_oldest_log_file_name_test', str(e)]
        error_item.append(error_item)
Ejemplo n.º 3
0
def create_new_log_manager_get_log_count_test():
    try:
        log_man = LogManager('tests/')
        if log_man is not None:
            log_count = log_man.get_log_count()
            success_item = 'create_new_log_manager_get_log_count_test'
            success_list.append(success_item)
        else:
            error_item = [
                'create_new_log_manager_get_log_count_test',
                'Could not create LogManager object'
            ]
            error_list.append(error_item)
    except Exception, e:
        error_item = ['create_new_log_manager_get_log_count_test', str(e)]
        error_item.append(error_item)
Ejemplo n.º 4
0
def create_new_log_manager_add_warning_entry_test():
    try:
        log_man = LogManager('tests/')
        if log_man is not None:
            log_man.add_warning_entry_to_log('Test WARNING entry')
            success_item = 'create_new_log_manager_add_warning_entry_test'
            success_list.append(success_item)
        else:
            error_item = [
                'create_new_log_manager_add_warning_entry_test',
                'Could not create LogManager object'
            ]
            error_list.append(error_item)
    except Exception, e:
        error_item = ['create_new_log_manager_add_warning_entry_test', str(e)]
        error_list.append(error_item)
Ejemplo n.º 5
0
import atexit
import sys
from time import sleep

import obdpi.shared_settings
from obdpi.log_manager import LogManager
from obdpi.obd_manager import ObdManager
from obdpi.oled_manager import OledManager
from obdpi.serial_manager import SerialManager

log_man = LogManager()
oled_man = OledManager()
ser_man = SerialManager()
obd_man = ObdManager()


@oled_man.oled_event_decorator("Ser Conn")
@log_man.log_event_decorator("Initialize Serial Connection", "INFO")
def init_serial(is_testing, environment):
    try:
        ser_man.init_serial_connection(is_testing, environment)
        if ser_man.has_serial_connection():
            return "SUCCESS"
        else:
            return "FAIL"
    except Exception, e:
        return "[EXCEPTION] " + str(e)


@oled_man.oled_event_decorator("OBD Conn")
@log_man.log_event_decorator("Initialize OBD Connection", "INFO")