File size: 1,936 Bytes
ad91e86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""The published code keeps its runtime helpers inside its own package."""

import importlib.util
from pathlib import Path


def test_habitat_helpers_are_packaged() -> None:
    assert importlib.util.find_spec("evolvingnav_paper.habitat_utils") is not None


def test_perception_does_not_import_the_original_readyagent_stack() -> None:
    source = (Path(__file__).resolve().parents[1] / "evolvingnav_paper/perception.py").read_text()
    assert "readyagent.artifacts" not in source
    assert "readyagent.perception" not in source


def test_navigation_cli_accepts_explicit_asset_paths() -> None:
    from evolvingnav_paper import run

    assert hasattr(run, "arguments")
    args = run.arguments([
        "--dataset", "/data/belief", "--tasks", "/data/tasks",
        "--hssd-root", "/data/hssd", "--navmesh-root", "/data/navmeshes",
        "--checkpoint", "/models/p4d.pt", "--output", "/tmp/p4d-run",
    ])
    assert args.navmesh_root == Path("/data/navmeshes")
    assert args.inspection == "grounded-sam"


def test_visual_verifier_accepts_explicit_asset_paths() -> None:
    from evolvingnav_paper import verify_visual

    assert hasattr(verify_visual, "arguments")
    args = verify_visual.arguments([
        "/tmp/p4d-run", "--tasks", "/data/tasks",
        "--hssd-root", "/data/hssd", "--navmesh-root", "/data/navmeshes",
    ])
    assert args.navmesh_root == Path("/data/navmeshes")


def test_unit_tests_do_not_require_the_local_benchmark_dataset() -> None:
    source = (Path(__file__).resolve().parent / "test_paper_code.py").read_text()
    assert "data/task_datasets" not in source


def test_record_packer_requires_an_explicit_dataset_root(monkeypatch) -> None:
    import sys

    import pytest
    from pack_p4d_hssd_records import arguments

    monkeypatch.setattr(sys, "argv", ["pack_p4d_hssd_records.py"])
    with pytest.raises(SystemExit) as error:
        arguments()
    assert error.value.code == 2