def test_refcount():
    genesis = resource.genesis
    terminus = resource.terminus
    called = {'genesis': False, 'terminus': False}

    def decorated_genesis():
        genesis()
        called['genesis'] = True

    def decorated_terminus():
        terminus()
        called['terminus'] = True

    resource.genesis = decorated_genesis
    resource.terminus = decorated_terminus
    assert not called['genesis']
    assert not called['terminus']
    assert resource.reference_count == 0
    resource.increment_refcount()
    assert called['genesis']
    assert not called['terminus']
    assert resource.reference_count == 1
    resource.increment_refcount()
    assert not called['terminus']
    assert resource.reference_count == 2
    resource.decrement_refcount()
    assert not called['terminus']
    assert resource.reference_count == 1
    resource.decrement_refcount()
    assert called['terminus']
    assert resource.reference_count == 0
Specified command-line arguments always overwrite config file values
dataset/ETHPy150Open dahlia/wand/tests/_resource_test.py/test_refcount--crossover with--dataset/ETHPy150Open CleanCut/green/green/test/test_config.py/TestMergeConfig.test_specified_command_line