mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
* tests: use remote fixtures * tests: use remote fixtures for data cloud tests * tests: treat remotes as tmp dirs
32 lines
614 B
Python
32 lines
614 B
Python
import pytest
|
|
|
|
from .base import Base
|
|
|
|
|
|
class HTTP(Base):
|
|
@staticmethod
|
|
def get_url(port):
|
|
return f"http://127.0.0.1:{port}"
|
|
|
|
def __init__(self, server):
|
|
self.url = self.get_url(server.server_port)
|
|
|
|
|
|
@pytest.fixture
|
|
def http_server(tmp_dir):
|
|
from tests.utils.httpd import PushRequestHandler, StaticFileServer
|
|
|
|
with StaticFileServer(handler_class=PushRequestHandler) as httpd:
|
|
yield httpd
|
|
|
|
|
|
@pytest.fixture
|
|
def http(http_server):
|
|
yield HTTP(http_server)
|
|
|
|
|
|
@pytest.fixture
|
|
def http_remote(tmp_dir, dvc, http):
|
|
tmp_dir.add_remote(config=http.config)
|
|
yield http
|