test_environment.py 403 Bytes
Newer Older
1 2 3 4 5 6 7 8
import vta


def test_env():
    env = vta.get_env()
    mock = env.mock
    assert mock.alu == "skip_alu"

9 10 11 12 13 14 15 16
def test_env_scope():
    env = vta.get_env()
    cfg = env.pkg_config().cfg_dict
    cfg["TARGET"] = "xyz"
    with vta.Environment(cfg):
        assert vta.get_env().TARGET == "xyz"
    assert vta.get_env().TARGET == env.TARGET

17 18 19

if __name__ == "__main__":
    test_env()
20
    test_env_scope()