def test_exists_not_exists(mock_get_all): """Return False if vf doesn't exist in SDC.""" vf_1 = Vf(name="one") vf_1.identifier = "1234" mock_get_all.return_value = [vf_1] vf = Vf(name="two") assert not vf.exists()
def test_exists_exists(mock_get_all): """Return True if vf exists in SDC.""" vf_1 = Vf(name="one") vf_1.identifier = "1234" vf_1.unique_uuid = "5689" vf_1.unique_identifier = "71011" vf_1.status = const.DRAFT vf_1.version = "1.1" mock_get_all.return_value = [vf_1] vf = Vf(name="one") assert vf.exists() assert vf.identifier == "1234" assert vf.unique_uuid == "5689" assert vf.unique_identifier == "71011" assert vf.status == const.DRAFT assert vf.version == "1.1"