예제 #1
0
def test_submit_not_Commited(mock_send, mock_load, mock_exists, status):
    """Do nothing if not created."""
    mock_exists.return_value = False
    pnf = Pnf()
    pnf._status = status
    pnf.submit()
    mock_send.assert_not_called()
예제 #2
0
def test_submit_OK(mock_send, mock_load, mock_exists):
    """Don't update status if submission NOK."""
    mock_exists.return_value = True
    pnf = Pnf()
    pnf._status = const.COMMITED
    expected_data = '{\n  "userRemarks": "certify"\n}'
    pnf._version = "1234"
    pnf._unique_identifier = "12345"
    pnf.submit()
    mock_send.assert_called_once_with(
        "POST",
        "Certify Pnf",
        'https://sdc.api.fe.simpledemo.onap.org:30207/sdc1/feProxy/rest/v1/catalog/resources/12345/lifecycleState/Certify',
        data=expected_data)