Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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'
Ejemplo n.º 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"
Ejemplo n.º 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'
Ejemplo n.º 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'))
Ejemplo n.º 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'))
Ejemplo n.º 9
0
def test_md5sum_none(tmpdir):

    assert md5sum(None) is None
Ejemplo n.º 10
0
def test_md5sum_none(tmpdir):
    assert md5sum(None) is None