def test(self): # Verify that if sys.stdin has no 'encoding' attribute we do the right # thing enc = isp.get_input_encoding() self.assertEqual(enc, 'ascii')
def test_get_input_encoding(): encoding = isp.get_input_encoding() assert isinstance(encoding, str) # simple-minded check that at least encoding a simple string works with the # encoding we got. assert "test".encode(encoding) == b"test"
def test_get_input_encoding(): encoding = isp.get_input_encoding() nt.assert_true(isinstance(encoding, basestring)) # simple-minded check that at least encoding a simple string works with the # encoding we got. nt.assert_equal('test'.encode(encoding), 'test')
def test_get_input_encoding(): encoding = isp.get_input_encoding() nt.assert_true(isinstance(encoding, string_types)) # simple-minded check that at least encoding a simple string works with the # encoding we got. nt.assert_equal(u'test'.encode(encoding), b'test')