#!/usr/bin/env python3
"""Unit tests for extract_data.py."""
import os
import sys

import pytest

from mined_metric.builder.metrics_impl.pisces.utils.extract_data import (
    check_sha_matches,
)


def test_sha_matches():
    """Tests determining whether SHAs match."""
    assert check_sha_matches("foo", "foo")
    assert not check_sha_matches("foo", "bar")
    assert check_sha_matches("foo", "foobar")


if __name__ == "__main__":
    args = [os.path.dirname(__file__), "--color=yes", "--verbose", "--verbose"]
    code = pytest.main(args)
    sys.exit(code)
