import pytest
from bitjws import PrivateKey, crypto, gen_privatekey

def test_verify():
    address = "1Jz43WvRgwRdvDzezbWdcSBfUuHSqtMSVx"

    b64sig = b"<KEY>
    msg = "test"
    assert crypto.verify(b64sig, msg, address)

    b64sig = b"<KEY>
    msg = "test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test"
    assert crypto.verify(b64sig, msg, address)

def test_badkey():
    key = gen_privatekey()
    with pytest.raises(TypeError):
        PrivateKey(key[:-1])

import pytest
from bitjws import PrivateKey, crypto, gen_privatekey

def test_verify():
    address = "1Jz43WvRgwRdvDzezbWdcSBfUuHSqtMSVx"

    b64sig = b"<KEY>
    msg = "test"
    assert crypto.verify(b64sig, msg, address)

    b64sig = b"<KEY>
    msg = "test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test"
    assert crypto.verify(b64sig, msg, address)

def test_badkey():
    key = gen_privatekey()
    with pytest.raises(TypeError):
        PrivateKey(key[:-1])
