def test_ingest_epv_into_graph8():
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(data_v9)
    expected = ({
        'ecosystem': 'npm',
        'message': 'Worker flows are disabled.',
        'packages': [{
            'package': 'pkg1',
            'version': 'ver1'
        }],
        'source': 'api'
    }, 201)
    assert result == expected
def test_ingest_epv_into_graph7(_mock1):
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(data_v9)
    expected = ({
        'ecosystem': 'npm',
        'message': 'Unknown package ingestion is disabled.',
        'packages': [{
            'package': 'pkg1',
            'version': 'ver1'
        }],
        'source': 'api'
    }, 201)
    assert result == expected
def test_ingest_epv_into_graph6(_mock, _mock1):
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(data_v8)

    expected = ({
        'ecosystem':
        'golang',
        'packages': [{
            'error_message': 'Golang pseudo version is not supported.',
            'package': 'pkg1',
            'version': 'ver1'
        }]
    }, 201)
    assert result == expected
def test_ingest_epv_into_graph1(_mock):
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(data_v2)
    expected = ({
        'ecosystem':
        'npm',
        'force':
        False,
        'force_graph_sync':
        True,
        'packages': [{
            'error_message': 'Incorrect data.',
            'pkg': 'pkg1',
            'ver': 'ver1'
        }],
        'recursive_limit':
        0
    }, 201)
    assert result == expected
def test_ingest_epv_into_graph(_mock):
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(data_v1)
    expected = ({
        'ecosystem':
        'npm',
        'force':
        False,
        'force_graph_sync':
        True,
        'packages': [{
            'dispacher_id': 'dummy_dispacher_id',
            'package': 'pkg1',
            'version': 'ver1'
        }],
        'recursive_limit':
        0
    }, 201)
    assert result == expected
def test_ingest_epv_into_graph4():
    """Tests for 'ingest_epv_into_graph'."""
    result = ingest_epv_into_graph(None)
    expected = ({"message": "Failed to initiate worker flow."}, 500)
    assert result == expected