Add UTs for VNF activities
Change-Id: I2e055bcecb358f1531052815d6a8ba89f8270b07
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
diff --git a/osm_lcm/temporal/vnf_activities.py b/osm_lcm/temporal/vnf_activities.py
index 6f64a82..2e8ab1c 100644
--- a/osm_lcm/temporal/vnf_activities.py
+++ b/osm_lcm/temporal/vnf_activities.py
@@ -1,5 +1,4 @@
-#######################################################################################
-# Copyright ETSI Contributors and Others.
+#########################################################################
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,7 +14,6 @@
# limitations under the License.
import logging
-from temporalio import activity
from osm_common.temporal_constants import (
ACTIVITY_CHANGE_VNF_STATE,
ACTIVITY_CHANGE_VNF_INSTANTIATION_STATE,
@@ -38,6 +36,7 @@
VnfInstantiateInput,
)
from osm_lcm.data_utils.database.database import Database
+from temporalio import activity
class VnfOperations:
@@ -52,7 +51,7 @@
"""Finds the appropriate task queue according to VIM type of VNF.
Collaborators:
- DB Access Object
+ DB read: vim_accounts, vnfrs
Raises (retryable):
DbException: If DB read operations fail, the collection or DB record ID does not exist.
@@ -112,7 +111,7 @@
"""Gets the VNF record and VNF descriptor from Database.
Collaborators:
- DB Access Object
+ DB read: vnfrs, vnfds
Raises (retryable):
DbException: If DB read operations fail, the collection or DB record ID does not exist.
@@ -134,8 +133,7 @@
class VnfDbActivity:
-
- """Perform Database operations for NS accounts.
+ """Perform Database operations for VNF accounts.
Args:
db (Database): Data Access Object
@@ -150,7 +148,7 @@
"""Updates the VNF State in VNFR.
Collaborators:
- DB Access Object
+ DB Write: vnfrs
Raises (retryable):
DbException: If DB access/update fails, the collection or DB record ID does not exist.
@@ -180,7 +178,7 @@
"""Updates the VNF Instantiation State in VNFR.
Collaborators:
- DB Access Object
+ DB Write: vnfrs
Raises (retryable):
DbException: If DB access or update fails, the collection or DB record ID does not exist.
@@ -214,7 +212,7 @@
"""Updates the model name of VNF in VNFR.
Collaborators:
- DB Access Object
+ DB Write: vnfrs
Raises (retryable):
DbException: If DB access or update fails, the collection or DB record ID does not exist.