Commit a579a6d0 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- Fixed unitary tests for Policy
parent 5b0d256b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ def test_policy(context_client : ContextClient):
    response = context_client.GetPolicyRule(PolicyRuleId(**POLICYRULE_ID))
    assert response.device.policyRuleBasic.policyRuleId.uuid.uuid == policyrule_uuid
    assert response.device.policyRuleBasic.priority == 1
    assert response.device.policyRuleBasic.kpiId.kpi_id.uuid == 'my-kpi-id'

    # ----- List when the object exists --------------------------------------------------------------------------------
    response = context_client.ListPolicyRuleIds(Empty())
@@ -57,6 +58,7 @@ def test_policy(context_client : ContextClient):
    assert len(response.policyRules) == 1
    assert response.policyRules[0].device.policyRuleBasic.policyRuleId.uuid.uuid == policyrule_uuid
    assert response.policyRules[0].device.policyRuleBasic.priority == 1
    assert response.policyRules[0].device.policyRuleBasic.kpiId.kpi_id.uuid == 'my-kpi-id'

    # ----- Update the object ------------------------------------------------------------------------------------------
    new_policy_priority = 100
@@ -80,7 +82,7 @@ def test_policy(context_client : ContextClient):
    assert len(response.policyRules) == 1
    assert response.policyRules[0].device.policyRuleBasic.policyRuleId.uuid.uuid == policyrule_uuid
    assert response.policyRules[0].device.policyRuleBasic.priority == new_policy_priority
    assert response.policyRules[0].device.policyRuleBasic.kpiId.kpi_id.uuid == new_policy_priority
    assert response.policyRules[0].device.policyRuleBasic.kpiId.kpi_id.uuid == new_policy_kpi_id

    # ----- Remove the object ------------------------------------------------------------------------------------------
    context_client.RemovePolicyRule(PolicyRuleId(**POLICYRULE_ID))