Fix execution bug

This commit is contained in:
Douglas Stebila 2019-07-30 22:41:34 -04:00
parent e7ecb4263a
commit cd744fa6b3

View File

@ -5,8 +5,7 @@ import pytest
@pytest.mark.parametrize('msg', ['', 'a', 'abc', '1234567890123456789012345678901678901567890'])
def test_sha256(msg):
output = helpers.run_subprocess(
['test_hash', 'sha256'],
working_dir = 'tests',
['tests/test_hash', 'sha256'],
input = msg.encode(),
)
assert(output.rstrip() == hashlib.sha256(msg.encode()).hexdigest())
@ -14,8 +13,7 @@ def test_sha256(msg):
@pytest.mark.parametrize('msg', ['', 'a', 'abc', '1234567890123456789012345678901678901567890'])
def test_sha384(msg):
output = helpers.run_subprocess(
['test_hash', 'sha384'],
working_dir = 'tests',
['tests/test_hash', 'sha384'],
input = msg.encode(),
)
assert(output.rstrip() == hashlib.sha384(msg.encode()).hexdigest())
@ -23,8 +21,7 @@ def test_sha384(msg):
@pytest.mark.parametrize('msg', ['', 'a', 'abc', '1234567890123456789012345678901678901567890'])
def test_sha512(msg):
output = helpers.run_subprocess(
['test_hash', 'sha512'],
working_dir = 'tests',
['tests/test_hash', 'sha512'],
input = msg.encode(),
)
assert(output.rstrip() == hashlib.sha512(msg.encode()).hexdigest())