Пример #1
0
def test_md5sum_existing_digest_but_missing_image(tmpdir):
    fake_img = str(tmpdir / "hello")

    with open(str(tmpdir / "hello.md5sum"), "w+") as f:
        f.write("aaaaa02abc4b2a76b9719d911017c592")

    assert md5sum(fake_img) is None
Пример #2
0
def test_md5sum_existing_digest_but_missing_image(tmpdir):
    fake_img = str(tmpdir / 'hello')

    with open(str(tmpdir / 'hello.md5sum'), 'w+') as f:
        f.write('aaaaa02abc4b2a76b9719d911017c592')

    assert md5sum(fake_img) is None
Пример #3
0
def test_md5sum_existing_digest_but_missing_image(tmpdir):
    fake_img = str(tmpdir / 'hello')

    with open(str(tmpdir / 'hello.md5sum'), 'w+') as f:
        f.write('aaaaa02abc4b2a76b9719d911017c592')

    assert md5sum(fake_img) is None
Пример #4
0
def test_md5sum(tmpdir):
    fake_img = str(tmpdir / 'hello载')

    with open(fake_img, 'w+') as f:
        f.write('hello')

    assert md5sum(fake_img) == '5d41402abc4b2a76b9719d911017c592'
    with open(str(tmpdir / 'hello载.md5sum')) as f:
        assert f.read() == '5d41402abc4b2a76b9719d911017c592'
Пример #5
0
def test_md5sum(tmpdir):
    fake_img = str(tmpdir / "hello载")

    with open(fake_img, "w+") as f:
        f.write("hello")

    assert md5sum(fake_img) == "5d41402abc4b2a76b9719d911017c592"
    with open(str(tmpdir / "hello载.md5sum")) as f:
        assert f.read() == "5d41402abc4b2a76b9719d911017c592"
Пример #6
0
def test_md5sum(tmpdir):
    fake_img = str(tmpdir / 'hello')

    with open(fake_img, 'w+') as f:
        f.write('hello')

    assert md5sum(fake_img) == '5d41402abc4b2a76b9719d911017c592'
    with open(str(tmpdir / 'hello.md5sum')) as f:
        assert f.read() == '5d41402abc4b2a76b9719d911017c592'
Пример #7
0
def test_md5sum_stopped_event(tmpdir):
    fake_img = str(tmpdir / 'hello_stopped')
    with open(fake_img, 'w+') as f:
        f.write('hello')

    event = threading.Event()
    event.set()

    assert md5sum(fake_img, stopped_event=event) is None
    assert not os.path.exists(str(tmpdir / 'hello_stopped.md5sum'))
Пример #8
0
def test_md5sum_stopped_event(tmpdir):
    fake_img = str(tmpdir / 'hello_stopped')
    with open(fake_img, 'w+') as f:
        f.write('hello')

    event = threading.Event()
    event.set()

    assert md5sum(fake_img, stopped_event=event) is None
    assert not os.path.exists(str(tmpdir / 'hello_stopped.md5sum'))
Пример #9
0
def test_md5sum_none(tmpdir):

    assert md5sum(None) is None
Пример #10
0
def test_md5sum_none(tmpdir):
    assert md5sum(None) is None