Example #1
0
def test_detect_private_key(input_s, expected_retval, tmpdir):
    path = os.path.join(tmpdir.strpath, 'file.txt')

    with open(path, 'wb') as file_obj:
        file_obj.write(input_s)

    assert detect_private_key([path]) == expected_retval
Example #2
0
def test_detect_private_key(input_s, expected_retval, tmpdir):
    path = tmpdir.join('file.txt')
    path.write_binary(input_s)
    assert detect_private_key([path.strpath]) == expected_retval