Ejemplo n.º 1
0
 def test_escape(self):
     TESTS = (
         ("", ""),
         ("a", "a"),
         ("a\nb\tc\rd\\e", "a\\nb\\tc\\rd\\\\e"),
         ("a\"b", "a\"b")
     )
     for test_line, expected in TESTS:
         actual = zenmap_wrapper.escape_key_file_value(test_line)
         self.assertEqual(expected, actual)
Ejemplo n.º 2
0
 def test_escape_first_space(self):
     # Check first-character space escaping.
     self.assert_(
         zenmap_wrapper.escape_key_file_value("  abc").startswith("\\s"))
Ejemplo n.º 3
0
 def test_escape_first_space(self):
     # Check first-character space escaping.
     self.assert_(zenmap_wrapper.escape_key_file_value("  abc").startswith("\\s"))
Ejemplo n.º 4
0
 def test_escape(self):
     TESTS = (("", ""), ("a", "a"), ("a\nb\tc\rd\\e", "a\\nb\\tc\\rd\\\\e"),
              ("a\"b", "a\"b"))
     for test_line, expected in TESTS:
         actual = zenmap_wrapper.escape_key_file_value(test_line)
         self.assertEqual(expected, actual)