aboutsummaryrefslogtreecommitdiffstats
path: root/test/bad_test_Utils.py
blob: 3e5cecd7d8f87eb92bfcd34f97cc3d5080fdbb0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
import json

from osdf.config.base import osdf_config
from osdf.utils.programming_utils import dot_notation


class TestUtils(unittest.TestCase):

    def test_metrics(self):
        with open('test/placement-tests/request.json', 'r') as f:
            data = json.load(f)
            placementInfo = data["placementInfo"]
            config_local = osdf_config.core
            self.assertEqual("USOSTCDALTX0101UJZZ11", dot_notation(placementInfo, config_local['service_info']['vCPE']['vcpeHostName']))
            self.assertEqual("200", dot_notation(placementInfo, config_local['service_info']['vCPE']['e2eVpnKey']))
            self.assertEqual(['vGMuxInfra', 'vG'], dot_notation(placementInfo, 'demandInfo.placementDemand.resourceModuleName'))


if __name__ == '__main__':
    unittest.main()