def test_quote_returns_bytes_when_input_is_bytes(self): self.assertTrue(isinstance(quoted(b'hello'), bytes))
def test_quote_escapes_backlash_character(self): self.assertEqual('"hello\\\\world"', quoted('hello\\world'))
def test_quote_returns_str_when_input_is_str(self): self.assertTrue(isinstance(quoted('hello'), str))
def test_quote_encloses_string_in_dquote_character(self): self.assertEqual('"hello"', quoted('hello'))
def test_quote_escapes_dquote_character(self): self.assertEqual('"hello\\"world"', quoted('hello"world'))