Esempio n. 1
0
def Name_escape0():
    """Tests that Name.escape for string not needing escaping returns the input
    string"""
    s = 'hello world'
    expected = s

    assert_eq(expected, Name.escape(s))
Esempio n. 2
0
def Name_escape1():
    """Tests that Name.escape for string needing escaping returns the correct
    string"""
    s = 'hello, "world"; insert <token + value>'
    expected = 'hello#2C #22world#22#3B insert #3Ctoken #2B value#3E'

    assert_eq(expected, Name.escape(s))
Esempio n. 3
0
def Name_escape1():
    """Tests that Name.escape for string needing escaping returns the correct
    string"""
    s = 'hello, "world"; insert <token + value>'
    expected = 'hello#2C #22world#22#3B insert #3Ctoken #2B value#3E'

    assert_eq(expected, Name.escape(s))
Esempio n. 4
0
    def test_unescape_with_escape(self):
        """Tests that Name.unescape for escaped string returns the correct
        string"""
        s = 'hello, "world"; insert <token + value>'

        self.assertEqual(
            s, Name.unescape(Name.escape(s)))
Esempio n. 5
0
def Name_escape0():
    """Tests that Name.escape for string not needing escaping returns the input
    string"""
    s = 'hello world'
    expected = s

    assert_eq(expected, Name.escape(s))
Esempio n. 6
0
    def test_escape_with_escape(self):
        """Tests that Name.escape for string needing escaping returns the
        correct string"""
        s = 'hello, "world"; insert <token + value>'
        expected = 'hello#2C #22world#22#3B insert #3Ctoken #2B value#3E'

        self.assertEqual(expected, Name.escape(s))
Esempio n. 7
0
    def test_escape_no_escape(self):
        """Tests that Name.escape for string not needing escaping returns the
        input string"""
        s = 'hello world'
        expected = s

        self.assertEqual(expected, Name.escape(s))
Esempio n. 8
0
    def test_escape_with_escape(self):
        """Tests that Name.escape for string needing escaping returns the
        correct string"""
        s = 'hello, "world"; insert <token + value>'
        expected = 'hello#2C #22world#22#3B insert #3Ctoken #2B value#3E'

        self.assertEqual(
            expected,
            Name.escape(s))
Esempio n. 9
0
    def test_escape_no_escape(self):
        """Tests that Name.escape for string not needing escaping returns the
        input string"""
        s = 'hello world'
        expected = s

        self.assertEqual(
            expected,
            Name.escape(s))
Esempio n. 10
0
def Name_unescape1():
    """Tests that Name.unescape for escaped string returns the correct string"""
    s = 'hello, "world"; insert <token + value>'

    assert_eq(s, Name.unescape(Name.escape(s)))
Esempio n. 11
0
def Name_unescape1():
    """Tests that Name.unescape for escaped string returns the correct string"""
    s = 'hello, "world"; insert <token + value>'

    assert_eq(s, Name.unescape(Name.escape(s)))
Esempio n. 12
0
    def test_unescape_with_escape(self):
        """Tests that Name.unescape for escaped string returns the correct
        string"""
        s = 'hello, "world"; insert <token + value>'

        self.assertEqual(s, Name.unescape(Name.escape(s)))