from typing import Tuple

import pytest

from mozilla_pipeline_schemas.bigquery import (
    checkout_transpile_schemas,
    git_stash_size,
    git_untracked_files,
    managed_git_state,
    transpile,
    write_schema_diff,
)
from mozilla_pipeline_schemas.utils import get_repository_root, run
from utils import runif_cli_configured

ROOT = get_repository_root()


def test_preconditions():
    assert (ROOT / "schemas").glob(
        "**/*.schema.json"
    ), "must contain at least one schema"
    assert (ROOT / "validation").glob(
        "**/*.pass.json"
    ), "must contain at least one passing validation document"


@runif_cli_configured
def test_transpile(tmp_path):
    test_schema = {"type": "string"}
    # --force-nullable
def test_get_repository_root():
    root = get_repository_root()
    assert (root / "README.md").exists()
    assert (root / "schemas").is_dir()