def test_get_all_no_pnf(mock_send):
    """Returns empty array if no pnfs."""
    mock_send.return_value = {}
    assert Pnf.get_all() == []
    mock_send.assert_called_once_with(
        "GET", 'get Pnfs',
        'https://sdc.api.be.simpledemo.onap.org:30204/sdc/v1/catalog/resources?resourceType=PNF'
    )
def test_get_all_some_pnfs(mock_send):
    """Returns a list of pnfs."""
    mock_send.return_value = [{
        'resourceType': 'PNF',
        'name': 'one',
        'uuid': '1234',
        'invariantUUID': '5678',
        'version': '1.0',
        'lifecycleState': 'CERTIFIED',
        'category': 'Generic',
        "subCategory": "Abstract"
    }, {
        'resourceType': 'PNF',
        'name': 'two',
        'uuid': '1235',
        'invariantUUID': '5679',
        'version': '1.0',
        'lifecycleState': 'NOT_CERTIFIED_CHECKOUT',
        'category': 'Generic',
        "subCategory": "Abstract"
    }]
    all_pnfs = Pnf.get_all()
    assert len(all_pnfs) == 2
    pnf_1 = all_pnfs[0]
    assert pnf_1.name == "one"
    assert pnf_1.identifier == "1234"
    assert pnf_1.unique_uuid == "5678"
    assert pnf_1.version == "1.0"
    assert pnf_1.status == const.CERTIFIED
    assert pnf_1.created()
    pnf_2 = all_pnfs[1]
    assert pnf_2.name == "two"
    assert pnf_2.identifier == "1235"
    assert pnf_2.unique_uuid == "5679"
    assert pnf_2.status == const.DRAFT
    assert pnf_2.version == "1.0"
    assert pnf_2.created()
    mock_send.assert_called_once_with(
        "GET", 'get Pnfs',
        'https://sdc.api.be.simpledemo.onap.org:30204/sdc/v1/catalog/resources?resourceType=PNF'
    )