2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2020-04-18 11:03:02 +00:00
|
|
|
# Copyright (C) 2019-2020 Tobias Gruetzmacher
|
2019-12-03 22:52:14 +00:00
|
|
|
import time
|
2020-10-04 21:24:05 +00:00
|
|
|
from pathlib import Path
|
2019-12-03 22:52:14 +00:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
2020-04-18 11:03:02 +00:00
|
|
|
@pytest.fixture()
|
|
|
|
def _nosleep(monkeypatch):
|
2019-12-03 22:52:14 +00:00
|
|
|
|
|
|
|
def sleep(seconds):
|
|
|
|
pass
|
|
|
|
|
|
|
|
monkeypatch.setattr(time, 'sleep', sleep)
|
2020-10-04 21:24:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class FakeAppdirs:
|
|
|
|
@property
|
|
|
|
def user_data_dir(self):
|
|
|
|
return str(Path(__file__).parent / 'mocks')
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def _noappdirs(monkeypatch):
|
|
|
|
monkeypatch.setattr('dosagelib.cmd.userdirs', FakeAppdirs())
|