Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
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"
Ejemplo n.º 3
0
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')
Ejemplo n.º 4
0
 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')
Ejemplo n.º 5
0
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')