# How to Run Tests for LingBot-Map: Validation Without a Conventional Test Suite

> Learn how to run tests for LingBot-Map. Validate functionality using import checks, the interactive demo script, and end-to-end benchmarks instead of a traditional test suite.

- Repository: [Robbyant/lingbot-map](https://github.com/Robbyant/lingbot-map)
- Tags: how-to-guide
- Published: 2026-07-19

---

**LingBot-Map does not ship with a traditional unit-test suite; instead, you validate functionality through import checks, the interactive demo script, and end-to-end benchmarks.**

The Robbyant/lingbot-map repository takes a non-traditional approach to quality assurance. Rather than maintaining a `tests/` directory with pytest-style unit tests, the project relies on integration-level validation scripts that exercise the full streaming-reconstruction pipeline. This guide explains how to verify your installation using the three verification mechanisms built into the codebase.

## Why LingBot-Map Uses Integration Testing Instead of Unit Tests

The codebase prioritizes end-to-end validation over isolated unit tests because the core functionality involves complex interactions between PyTorch models, FlashInfer KV-caches, ONNX runtime components, and the Viser visualizer. Testing these integrations in isolation would miss critical failure modes in the data pipeline. According to the repository structure, validation occurs through import-time checks in [`lingbot_map/__init__.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/__init__.py), the executable demo in [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py), and the benchmark drivers in [`benchmark/run.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/run.py).

## Method 1: Import-Time Sanity Checks

The fastest way to verify a clean installation is to attempt importing the top-level package. If any mandatory dependency—such as PyTorch or FlashInfer—is missing or incompatible, Python raises an exception immediately.

The entry point [`lingbot_map/__init__.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/__init__.py) registers the package and exposes `__version__`. Successfully importing this module confirms that the package is correctly built and that runtime dependencies are available.

```bash
python -c "import lingbot_map; print('Version:', lingbot_map.__version__)"

```

If this command executes without errors, your environment satisfies the basic requirements listed in [`pyproject.toml`](https://github.com/Robbyant/lingbot-map/blob/main/pyproject.toml).

## Method 2: Run the Interactive Demo

The [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py) script serves as the canonical functional test. It executes a full streaming-reconstruction pipeline on a small example dataset located in `example/university`, utilizing the FlashInfer KV-cache, an optional sky-masking ONNX model, and the Viser visualizer.

Successfully completing this demo proves that the model checkpoint loads correctly, the inference pipeline functions end-to-end, and the visualization stack is operational.

```bash
python demo.py \
    --model_path /path/to/lingbot-map-long.pt \
    --image_folder example/university \
    --mask_sky

```

When executed, this command opens a browser-based visualizer. If the window renders the reconstructed scene without crashing, all critical subsystems are wired correctly.

## Method 3: Execute Benchmark Scripts

For rigorous validation against established datasets, use the benchmark suite located in the `benchmark/` directory. The script [`benchmark/run.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/run.py) drives end-to-end evaluation pipelines, while [`benchmark/prepare.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/prepare.py) handles dataset preparation.

Running a benchmark on a prepared dataset—such as the Oxford Spires benchmark—exercises the data-loader, the model's forward pass, and post-processing utilities. This is the closest equivalent to a full regression test.

```bash
python benchmark/run.py \
    --dataset oxford \
    --model_path /path/to/lingbot-map-long.pt \
    --output_dir benchmark/results/oxford

```

Successful completion indicates that the data pipeline, model inference, and evaluation metrics are fully functional.

## How to Add Formal Unit Tests (Optional)

If you extend LingBot-Map and wish to add conventional unit tests, you can use Python's built-in discovery mechanisms. However, as of the current codebase, no test files exist, so these commands will report "no tests found" until you create modules matching the discovery patterns.

**Using unittest:**

```bash
python -m unittest discover -s lingbot_map -p "test_*.py"

```

**Using pytest:**

```bash
pip install pytest
pytest lingbot_map

```

Create test modules (e.g., [`test_gct_stream.py`](https://github.com/Robbyant/lingbot-map/blob/main/test_gct_stream.py)) inside the package directory to have them automatically discovered and executed.

## Step-by-Step Validation Workflow

Follow this sequence to verify that the LingBot-Map codebase is correctly installed and operational:

1. **Install the package:** Run `pip install -e .` to build the package in editable mode and register the `lingbot_map` import.

2. **Verify the import:** Execute `python -c "import lingbot_map"` to confirm that all required runtime dependencies are available.

3. **Run the interactive demo:** Execute `python demo.py --model_path <path_to_checkpoint> --image_folder example/university --mask_sky` to perform full streaming inference and launch the browser-based visualizer.

4. **(Optional) Run a benchmark:** Execute `python benchmark/run.py --dataset oxford --model_path <path_to_checkpoint>` to perform end-to-end evaluation on a larger benchmark.

## Summary

- **LingBot-Map lacks a traditional `tests/` directory** and instead validates functionality through integration tests.
- **Import [`lingbot_map/__init__.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/__init__.py)** to verify installation and dependencies without running inference.
- **Execute [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py)** to test the full streaming-reconstruction pipeline, including the FlashInfer KV-cache and Viser visualizer.
- **Run [`benchmark/run.py`](https://github.com/Robbyant/lingbot-map/blob/main/benchmark/run.py)** for end-to-end evaluation on standard datasets like Oxford Spires.
- **Use `unittest` or `pytest`** to discover future test files if you add them to the repository.

## Frequently Asked Questions

### Does LingBot-Map include a pytest test suite?

No, the Robbyant/lingbot-map repository does not currently include a pytest test suite or a `tests/` directory. The project relies on import-time checks, the demo script, and benchmark evaluations to validate functionality.

### How do I verify that LingBot-Map is installed correctly?

Run `python -c "import lingbot_map"` to execute the import-time sanity check defined in [`lingbot_map/__init__.py`](https://github.com/Robbyant/lingbot-map/blob/main/lingbot_map/__init__.py). If the command exits silently or prints the version number, the package is correctly installed and all mandatory dependencies are present.

### What does the demo.py script actually test?

The [`demo.py`](https://github.com/Robbyant/lingbot-map/blob/main/demo.py) script tests the full inference pipeline: it loads a model checkpoint, processes images from a local folder using the FlashInfer KV-cache, optionally applies sky-masking via an ONNX model, and launches the Viser visualizer. Successfully rendering the output proves that the core model and visualization stack are operational.

### Can I use unittest to add tests to LingBot-Map?

Yes, you can add conventional unit tests by creating files matching the `test_*.py` pattern inside the `lingbot_map` directory. Use `python -m unittest discover -s lingbot_map -p "test_*.py"` to run them, or install pytest and run `pytest lingbot_map` for more detailed reporting.