# encoding=utf-8

from lib.request_process import HttpRequest
from lib.result_cmp import ResultCmp
from lib.file_process import read_file
from project.personas.test_cases import conf as cf
from config.conf import logger
import unittest
#import nose

ip = cf.ip
path = cf.path_config
#path1 = '/ofo/get_config'
#logger = config.logger


class TestGetConfig(unittest.TestCase):

    def test_get_config(self):
        logger.set_log('start test... ', level='info')
        rq = HttpRequest(ip)
        rs = rq.http_request(path)
        assert rs.status_code == 200
        file_name = 'data/test_positive.json'
        expect_result = read_file(file_name)
        actual_result = rs.content
        compare = ResultCmp(expect_result, actual_result)
        assert compare.full_cmp() == 0

    #@unittest.skip("I don't want to run this case.")
    def test1(self):
        False

'''
class TestEstimate(unittest.TestCase):

    def test_estimate_result(self):
        logger.set_log('start test... ', level='info')
        rq = HttpRequest(ip)
        rs = rq.http_request(path1)
        assert rs.status_code == 200
        file_name = 'data/test_positive.json'
        expect_result = read_file(file_name)
        actual_result = rs.content
        compare = ResultCmp(expect_result, actual_result)
        assert compare.full_cmp() == 1

    #@unittest.skip("I don't want to run this case.")
    def test1(self):
        False

'''

if __name__ == '__main__':
    unittest.main()

