def test_escape_attr(self): # unicode self.assertEquals(u'"Me & you!"', xmlio._escape_attr(u'"Me\x01 & you\x86!"')) # str self.assertEquals('"Me & you!"', xmlio._escape_attr('"Me\x01 & you\x86!"')) # not basestring self.assertEquals(42, xmlio._escape_text(42))
def setUp(self): self.work_dir = tempfile.mkdtemp(prefix='bitten_test') self.python_path = xmlio._escape_attr(sys.executable)