Exemplo n.º 1
0
def test_global():
    t = VariableTracking()
    t.ignore_global("FOO")
    assert (not t.is_explicitly_configured_local("FOO"))
    assert (t.is_explicitly_configured_global("FOO"))
    assert (not t.is_tracked("FOO"))

    t.unset_global("FOO")
    assert (not t.is_explicitly_configured_local("FOO"))
    assert (not t.is_explicitly_configured_global("FOO"))
    assert (t.is_tracked("FOO"))
Exemplo n.º 2
0
def test_track_uses_config_file(tmp_json):
    cfg = ConfigurationFile(tmp_json, VariableTracking.config_schema_global)
    vtr = VariableTracking(cfg, None)

    vtr.ignore_global("FOO")
    assert (not vtr.is_tracked("FOO"))
    assert (not vtr.is_explicitly_configured_local("FOO"))
    assert (vtr.is_explicitly_configured_global("FOO"))

    cfg.save()

    cfg2 = ConfigurationFile(tmp_json, VariableTracking.config_schema_local)
    vtr2 = VariableTracking(None, cfg2)
    assert (not vtr2.is_tracked("FOO"))
    assert (vtr2.is_explicitly_configured_local("FOO"))
    assert (not vtr2.is_explicitly_configured_global("FOO"))