kapsikkum-unmanic – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3  
4 """
5 unmanic.test_unlogger.py
6  
7 Written by: Josh.5 <jsunnex@gmail.com>
8 Date: 08 Sep 2019, (8:45 AM)
9  
10 Copyright:
11 Copyright (C) Josh Sunnex - All Rights Reserved
12  
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19  
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22  
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
29 OR OTHER DEALINGS IN THE SOFTWARE.
30  
31 """
32  
33 import os
34 import sys
35  
36 import pytest
37  
38 try:
39 from unmanic.libs import unlogger
40 except ImportError:
41 project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
42 sys.path.append(project_dir)
43 from unmanic.libs import unlogger
44  
45  
46 class SettingsObject(object):
47 pass
48  
49  
50  
51 # TODO: Re-enable unit test once config object can be called without a DB connection
52 class TestClass(object):
53 """
54 TestClass
55  
56 Runs unit tests against the unlogger class
57  
58 """
59  
60 def setup_class(self):
61 """
62 Setup the class state for pytest
63 :return:
64 """
65 # Logging file handler is disabled for unit tests
66 unmanic_logging = unlogger.UnmanicLogger.__call__(False)
67 unmanic_logging.get_logger()
68  
69 @pytest.mark.unittest
70 def test_logging_special_characters(self):
71 unmanic_logging = unlogger.UnmanicLogger.__call__()
72 main_logger = unmanic_logging.get_logger()
73 main_logger.info("Check that these characters display correctly")
74 main_logger.info("Success: \u251c – € ’ “ ” « » — à á ã ç ê é í ó õ ú")
75 main_logger.info("Fails: \udce2\udc80\udc98")