Пример #1
0
def test_get_latest_flow_ver(fixture_versioned_flow):
    test_rc, test_rb, test_pg, test_p, test_vf = fixture_versioned_flow
    r1 = versioning.get_latest_flow_ver(
        test_rb.identifier, test_vf.version_control_information.flow_id)
    assert isinstance(r1, registry.VersionedFlowSnapshot)
    with pytest.raises(ValueError, match='Versioned flow does not exist'):
        _ = versioning.get_latest_flow_ver(test_rb.identifier, 'fakenews')
Пример #2
0
def test_get_latest_flow_ver(regress_flow_reg, fix_ver_flow):
    r1 = versioning.get_latest_flow_ver(fix_ver_flow.bucket.identifier,
                                        fix_ver_flow.flow.identifier)
    assert isinstance(r1, registry.VersionedFlowSnapshot)
    with pytest.raises(ValueError, match='does not exist'):
        _ = versioning.get_latest_flow_ver(fix_ver_flow.bucket.identifier,
                                           'fakenews')
Пример #3
0
def test_create_flow_version(regress_flow_reg, fix_ver_flow):
    new_ver_stub = versioning.create_flow(
        bucket_id=fix_ver_flow.bucket.identifier,
        flow_name=conftest.test_cloned_ver_flow_name,
    )
    ver_flow_snapshot_0 = versioning.get_latest_flow_ver(
        fix_ver_flow.bucket.identifier,
        fix_ver_flow.flow.identifier
    )
    r1 = versioning.create_flow_version(
        flow=new_ver_stub,
        flow_snapshot=ver_flow_snapshot_0
    )
    assert isinstance(r1, registry.VersionedFlowSnapshot)
    # registry bug https://issues.apache.org/jira/browse/NIFIREG-135
    # assert r1.flow.version_count == 2
    assert DeepDiff(
        ver_flow_snapshot_0.flow_contents,
        r1.flow_contents,
        ignore_order=False,
        verbose_level=2
    ) == {}
    # Write it again to increment the version, check it's consistent
    r2 = versioning.create_flow_version(
        flow=new_ver_stub,
        flow_snapshot=ver_flow_snapshot_0
    )
    assert isinstance(r2, registry.VersionedFlowSnapshot)
    assert DeepDiff(
        ver_flow_snapshot_0.flow_contents,
        r2.flow_contents,
        ignore_order=False,
        verbose_level=2
    ) == {}