1
# -*- encoding: utf-8 -*-
2
from landscape.package.interface import LandscapeInterface
4
from landscape.tests.helpers import LandscapeTest
5
from landscape.package.tests.helpers import SmartFacadeHelper
8
class LandscapeInterfaceTest(LandscapeTest):
10
helpers = [SmartFacadeHelper]
13
super(LandscapeInterfaceTest, self).setUp()
14
self.facade.reload_channels()
15
self.iface = LandscapeInterface(None)
17
def test_message_with_unicode_and_utf8(self):
18
self.iface.info(u"áéíóú")
19
self.iface.info("áéíóú")
20
self.assertEquals(self.iface.get_output_for_landscape(),
21
u"INFO: áéíóú\nINFO: áéíóú\n")
23
def test_message_with_unicode_and_unknown_encoding(self):
24
self.iface.info(u"áéíóú")
25
self.iface.info("aeíou\xc3") # UTF-8 expects a byte after \xc3
26
c = u"\N{REPLACEMENT CHARACTER}"
27
self.assertEquals(self.iface.get_output_for_landscape(),
28
u"INFO: áéíóú\nINFO: ae%s%sou%s\n" % (c, c, c))
30
def test_output_with_unicode_and_utf8(self):
31
self.iface.showOutput(u"áéíóú")
32
self.iface.showOutput("áéíóú")
33
self.assertEquals(self.iface.get_output_for_landscape(),