3
from juju.lib.testing import TestCase
4
from juju.lib.under import quote
7
class UnderTest(TestCase):
9
def test_unmodified(self):
10
s = string.ascii_letters + string.digits + "-."
12
self.assertEquals(quote(s), s)
13
self.assertTrue(isinstance(q, str))
16
s = "hello_there/how'are~you-today.sir"
18
self.assertEquals(q, "hello_5f_there_2f_how_27_are_7e_you-today.sir")
19
self.assertTrue(isinstance(q, str))
21
def test_coincidentally_unicode(self):
22
s = u"hello_there/how'are~you-today.sir"
24
self.assertEquals(q, "hello_5f_there_2f_how_27_are_7e_you-today.sir")
25
self.assertTrue(isinstance(q, str))
27
def test_necessarily_unicode(self):
28
s = u"hello\u1234there"
29
self.assertRaises(KeyError, quote, s)