Beispiel #1
0
def test_show_warning_once(caplog, make_remote):
    remote = make_remote()
    slow_link_guard(lambda x: None)(remote)
    slow_link_guard(lambda x: None)(remote)

    slow_link_detection = dvc.objects.db.slow_link_detection
    message = slow_link_detection.message  # noqa, pylint: disable=no-member
    assert len(caplog.records) == 1
    assert caplog.records[0].message == message
Beispiel #2
0
def test_dont_warn_when_warning_is_disabled(caplog, make_remote):
    remote = make_remote(should_warn=False)
    slow_link_guard(lambda x: None)(remote)

    assert len(caplog.records) == 0
Beispiel #3
0
def test_dont_warn_when_cache_type_is_set(caplog, make_remote):
    remote = make_remote(cache_type="copy")
    slow_link_guard(lambda x: None)(remote)

    assert len(caplog.records) == 0