예제 #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')
예제 #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"
예제 #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')
예제 #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')
예제 #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')