Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update tests.py #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update tests.py #36

wants to merge 1 commit into from

Conversation

legerde
Copy link

@legerde legerde commented Oct 4, 2017

I had to change line 116 to get the assert to compare properly. They were "equal", but in different types.

The left had side was a string array of 99 characters: "[0, 20, 117, 30, 118, 232, 25, 145, 150, 212, 84, 148, 28, 69, 209, 179, 163, 35, 241, 67, 59, 214]"

The right hand side was a 22 character string: \x00\x14u\x1ev\xe8\x19\x91\x96\xd4T\x94\x1cE\xd1\xb3\xa3#\xf1C;\xd6

Runnings tests.py gave me the following before the proposed change:

FAIL: test_valid_address (main.TestSegwitAddress)
Test whether valid addresses decode to the correct output.

Traceback (most recent call last):
File "tests.py", line 118, in test_valid_address
self.assertEqual(scriptpubkey, binascii.unhexlify(hexscript))
AssertionError: '[0, 20, 117, 30, 118, 232, 25, 145, 150, 212, 84, 148, 28, 69, 209, 179, 163, 35, 241, 67, 59, 214]' != '\x00\x14u\x1ev\xe8\x19\x91\x96\xd4T\x94\x1cE\xd1\xb3\xa3#\xf1C;\xd6'


Ran 5 tests in 0.016s

With the change I get:

python tests.py
.....


Ran 5 tests in 0.016s

OK

I had to change line 116 to get the assert to compare properly.   They were "equal", but in different types.   

The left had side was a string array of 99 characters: "[0, 20, 117, 30, 118, 232, 25, 145, 150, 212, 84, 148, 28, 69, 209, 179, 163, 35, 241, 67, 59, 214]"

The right hand side was a 22 character string: \x00\x14u\x1ev\xe8\x19\x91\x96\xd4T\x94\x1cE\xd1\xb3\xa3#\xf1C;\xd6

Runnings tests.py gave me the following before the proposed change:

F.
======================================================================
FAIL: test_valid_address (__main__.TestSegwitAddress)
Test whether valid addresses decode to the correct output.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 118, in test_valid_address
    self.assertEqual(scriptpubkey, binascii.unhexlify(hexscript))
AssertionError: '[0, 20, 117, 30, 118, 232, 25, 145, 150, 212, 84, 148, 28, 69, 209, 179, 163, 35, 241, 67, 59, 214]' != '\x00\x14u\x1ev\xe8\x19\x91\x96\xd4T\x94\x1cE\xd1\xb3\xa3#\xf1C;\xd6'

----------------------------------------------------------------------
Ran 5 tests in 0.016s

With the change I get:
>python tests.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.016s

OK
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant