Пример #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'))