Fixes bugs for integration with MON module
[osm/MON.git] / policy_module / osm_policy_module / tests / unit / test_policy_config_agent.py
diff --git a/policy_module/osm_policy_module/tests/unit/test_policy_config_agent.py b/policy_module/osm_policy_module/tests/unit/test_policy_config_agent.py
new file mode 100644 (file)
index 0000000..7618682
--- /dev/null
@@ -0,0 +1,21 @@
+import json
+import os
+import unittest
+
+from osm_policy_module.core.agent import PolicyModuleAgent
+
+
+class PolicyAgentTest(unittest.TestCase):
+    def setUp(self):
+        self.agent = PolicyModuleAgent()
+
+    def test_get_alarm_configs(self):
+        with open(os.path.join(os.path.dirname(__file__), '../examples/configure_scaling_full_example.json')) as file:
+            example = json.load(file)
+            alarm_configs = self.agent._get_alarm_configs(example)
+            # TODO Improve assertions
+            self.assertEqual(len(alarm_configs), 2)
+
+
+if __name__ == '__main__':
+    unittest.main()