#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author:  Dominik Gresch <greschd@gmx.ch>

import os

import pytest
import tempfile
from click.testing import CliRunner

import tbmodels
from tbmodels._cli import cli
from parameters import SAMPLES_DIR

@pytest.mark.parametrize('prefix', ['silicon', 'bi'])
def test_cli_parse(models_equal, prefix):
    runner = CliRunner()
    with tempfile.TemporaryDirectory() as d:
        out_file = os.path.join(d, 'model_out.hdf5')
        runner.invoke(cli, ['parse', '-o', out_file, '-f', SAMPLES_DIR, '-p', prefix])
        model_res = tbmodels.Model.from_hdf5_file(out_file)
    model_reference = tbmodels.Model.from_wannier_folder(folder=SAMPLES_DIR, prefix=prefix)
    models_equal(model_res, model_reference)

Add test for CLI parse
Add test for CLI parse
