示例#1
0
 def test_quote_returns_bytes_when_input_is_bytes(self):
     self.assertTrue(isinstance(quoted(b'hello'), bytes))
示例#2
0
 def test_quote_escapes_backlash_character(self):
     self.assertEqual('"hello\\\\world"', quoted('hello\\world'))
示例#3
0
 def test_quote_returns_str_when_input_is_str(self):
     self.assertTrue(isinstance(quoted('hello'), str))
示例#4
0
 def test_quote_encloses_string_in_dquote_character(self):
     self.assertEqual('"hello"', quoted('hello'))
示例#5
0
 def test_quote_escapes_dquote_character(self):
     self.assertEqual('"hello\\"world"', quoted('hello"world'))
示例#6
0
 def test_quote_returns_bytes_when_input_is_bytes(self):
     self.assertTrue(isinstance(quoted(b'hello'), bytes))
示例#7
0
 def test_quote_returns_str_when_input_is_str(self):
     self.assertTrue(isinstance(quoted('hello'), str))
示例#8
0
 def test_quote_escapes_backlash_character(self):
     self.assertEqual('"hello\\\\world"', quoted('hello\\world'))
示例#9
0
 def test_quote_escapes_dquote_character(self):
     self.assertEqual('"hello\\"world"', quoted('hello"world'))
示例#10
0
 def test_quote_encloses_string_in_dquote_character(self):
     self.assertEqual('"hello"', quoted('hello'))