Trees | Indices | Help |
|
---|
|
1 #-*- coding: utf8 -* 2 # 3 # Max E. Kuznecov ~syhpoon <mek@mek.uz.ua> 2008-2009 4 # 5 # This file is part of XYZCommander. 6 # XYZCommander is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU Lesser Public License as published by 8 # the Free Software Foundation, either version 3 of the License, or 9 # (at your option) any later version. 10 # XYZCommander is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU Lesser Public License for more details. 14 # You should have received a copy of the GNU Lesser Public License 15 # along with XYZCommander. If not, see <http://www.gnu.org/licenses/>. 16 17 # UI tests 18 19 from nose.tools import raises 20 21 from libxyz.ui import colors 22 from libxyz.exceptions import XYZValueError 23 24 import __builtin__ 25 import locale 3032 @raises(XYZValueError) 39 40 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41153 15843 """ 44 Check correct color 45 """ 46 47 assert colors.Foreground("BLACK") 48 assert colors.Foreground("DARK_BLUE") 49 assert colors.Foreground("LIGHT_RED") 50 assert colors.Foreground("DEFAULT") 51 52 assert colors.Foreground("BLACK") 53 assert colors.Foreground("BROWN") 54 assert colors.Foreground("YELLOW") 55 assert colors.Foreground("WHITE") 56 assert colors.Foreground("DEFAULT") 57 58 assert colors.Foreground("DARK_BLUE") 59 assert colors.Foreground("DARK_MAGENTA") 60 assert colors.Foreground("DARK_CYAN") 61 assert colors.Foreground("DARK_RED") 62 assert colors.Foreground("DARK_GREEN") 63 assert colors.Foreground("DARK_GRAY") 64 65 assert colors.Foreground("LIGHT_GRAY") 66 assert colors.Foreground("LIGHT_RED") 67 assert colors.Foreground("LIGHT_GREEN") 68 assert colors.Foreground("LIGHT_BLUE") 69 assert colors.Foreground("LIGHT_MAGENTA") 70 assert colors.Foreground("LIGHT_CYAN")71 72 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 74 @raises(XYZValueError) 81 82 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8385 """ 86 Check correct color 87 """ 88 89 assert colors.Background("BLACK") 90 assert colors.Background("BROWN") 91 assert colors.Background("DEFAULT") 92 93 assert colors.Background("DARK_RED") 94 assert colors.Background("DARK_GREEN") 95 assert colors.Background("DARK_BLUE") 96 assert colors.Background("DARK_MAGENTA") 97 assert colors.Background("DARK_CYAN") 98 99 assert colors.Background("LIGHT_GRAY")100 101 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 102 103 @raises(XYZValueError) 110 111 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 112114 """ 115 Check correct attribute 116 """ 117 118 assert colors.Attribute("BOLD") 119 assert colors.Attribute("UNDERLINE") 120 assert colors.Attribute("BLINK") 121 assert colors.Attribute("STANDOUT")122 123 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 125 @raises(XYZValueError) 128 129 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 130 131 @raises(XYZValueError) 134 135 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136138 assert cl("#009") 139 assert cl("#fcc") 140 assert cl("g40") 141 assert cl("g#cc") 142 assert cl("h8")143 144 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 148 149 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 150
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Sep 16 01:52:00 2010 | http://epydoc.sourceforge.net |