def test_exists(mock_get_all):
    """Return True if pnf exists in SDC."""
    pnf_1 = Pnf(name="one")
    pnf_1.identifier = "1234"
    pnf_1.unique_uuid = "5689"
    pnf_1.unique_identifier = "71011"
    pnf_1.status = const.DRAFT
    pnf_1.version = "1.1"
    mock_get_all.return_value = [pnf_1]
    pnf = Pnf(name="one")
    assert pnf.exists()
    assert pnf.identifier == "1234"
    assert pnf.unique_uuid == "5689"
    assert pnf.unique_identifier == "71011"
    assert pnf.status == const.DRAFT
    assert pnf.version == "1.1"
def test_add_artifact_to_pnf(mock_send_message, mock_load):
    """Test Pnf add artifact"""
    pnf = Pnf(name="test")
    pnf.status = const.DRAFT
    mycbapath = Path(
        Path(__file__).resolve().parent, "data/vLB_CBA_Python.zip")

    result = pnf.add_deployment_artifact(
        artifact_label="cba",
        artifact_type="CONTROLLER_BLUEPRINT_ARCHIVE",
        artifact_name="vLB_CBA_Python.zip",
        artifact=mycbapath)
    mock_send_message.assert_called()
    method, description, url = mock_send_message.call_args[0]
    assert method == "POST"
    assert description == "Add deployment artifact for test sdc resource"
    assert url == (
        "https://sdc.api.fe.simpledemo.onap.org:30207/sdc1/feProxy/rest/v1/catalog/resources/"
        f"{pnf.unique_identifier}/artifacts")