mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-07-06 18:57:49 +02:00
feat: FuzzForge AI - complete rewrite for OSS release
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pytest_plugins = ["fuzzforge_tests.fixtures"]
|
||||
@@ -0,0 +1,9 @@
|
||||
import pytest
|
||||
|
||||
from fuzzforge_common.sandboxes.engines.podman.engine import Podman
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def podman_engine(podman_socket: str) -> Podman:
|
||||
"""TODO."""
|
||||
return Podman(socket=podman_socket)
|
||||
@@ -0,0 +1,21 @@
|
||||
from typing import TYPE_CHECKING
|
||||
from uuid import uuid4
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
from podman import PodmanClient
|
||||
|
||||
from fuzzforge_common.sandboxes.engines.podman.engine import Podman
|
||||
|
||||
|
||||
def test_can_register_oci(
|
||||
path_to_oci: Path,
|
||||
podman_engine: Podman,
|
||||
podman_client: PodmanClient,
|
||||
) -> None:
|
||||
"""TODO."""
|
||||
repository: str = str(uuid4())
|
||||
podman_engine.register_archive(archive=path_to_oci, repository=repository)
|
||||
assert podman_client.images.exists(key=repository)
|
||||
podman_client.images.get(name=repository).remove()
|
||||
@@ -0,0 +1,42 @@
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fuzzforge_common.storage.configuration import StorageConfiguration
|
||||
|
||||
|
||||
def test_download_directory(
|
||||
storage_configuration: StorageConfiguration,
|
||||
boto3_client: Any,
|
||||
random_bucket: str,
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
"""TODO."""
|
||||
bucket = random_bucket
|
||||
storage = storage_configuration.into_storage()
|
||||
|
||||
d1 = tmp_path.joinpath("d1")
|
||||
f1 = d1.joinpath("f1")
|
||||
d2 = tmp_path.joinpath("d2")
|
||||
f2 = d2.joinpath("f2")
|
||||
d3 = d2.joinpath("d3")
|
||||
f3 = d3.joinpath("d3")
|
||||
|
||||
d1.mkdir()
|
||||
d2.mkdir()
|
||||
d3.mkdir()
|
||||
f1.touch()
|
||||
f2.touch()
|
||||
f3.touch()
|
||||
|
||||
for path in [f1, f2, f3]:
|
||||
key: Path = Path("assets", path.relative_to(other=tmp_path))
|
||||
boto3_client.upload_file(
|
||||
Bucket=bucket,
|
||||
Filename=str(path),
|
||||
Key=str(key),
|
||||
)
|
||||
|
||||
path = storage.download_directory(bucket=bucket, directory="assets")
|
||||
|
||||
assert path.is_file()
|
||||
Reference in New Issue
Block a user