On 01/12/2014 02:32 PM, Mark Lawrence wrote:

I've just tried asciistr using your test code (having corrected the typo, it's 
assertIsInstance, not assertIsinstance :)
and it looks like a very good starting point.  Have you, or anyone else for 
that matter, actually tried asciistr out?

Ah, thanks for that fix, and thanks for trying it out.  Um, how exactly did you 
try it out?  This is what I did:

bytestring_test.py
==================
from asciicompat import asciistr as bytestring

...
==================

ethan@media:~/source/bytestring$ python3.4 bytestring_test.py
.F.FFF
======================================================================
FAIL: test_bytestring_will_accept_codepoints_in_latin1 (__main__.TestByteString)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "bytestring_test.py", line 30, in 
test_bytestring_will_accept_codepoints_in_latin1
    self.assertEqual(bytestring(char), bytes([ch]))
AssertionError: '\x00' != b'\x00'

======================================================================
FAIL: test_from_str_plus_str (__main__.TestByteString)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "bytestring_test.py", line 9, in test_from_str_plus_str
    self.assertEqual(result, b'hello world')
AssertionError: 'hello world' != b'hello world'

======================================================================
FAIL: test_interpolation (__main__.TestByteString)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "bytestring_test.py", line 33, in test_interpolation
    self.assertEqual(bytestring('Content-Length: %d') % 71, b'Content-Length: 
71')
AssertionError: 'Content-Length: 71' != b'Content-Length: 71'

======================================================================
FAIL: test_str_plus_from_str (__main__.TestByteString)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "bytestring_test.py", line 14, in test_str_plus_from_str
    result = 'hello' + bytestring('world')
AssertionError: TypeError not raised

----------------------------------------------------------------------
Ran 6 tests in 0.002s

FAILED (failures=4)

Four out of six failed is not a good beginning.  :(

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to