Add sonar pom and tox hooks.
[ric-plt/a1.git] / tests / testing_helpers.py
index b258a85..c59426b 100644 (file)
@@ -24,18 +24,18 @@ def _get_fixture_path(name):
     return "{0}/fixtures/{1}".format(cur_dir, name)
 
 
-def patch_all(monkeypatch, nonexisting_rmr=False):
+def patch_all(monkeypatch, nonexisting_rmr=False, nofetch=False):
     rmr_mocks.patch_rmr(monkeypatch)
 
     # patch manifest
     man = json.loads(open(_get_fixture_path("ricmanifest.json"), "r").read())
     if nonexisting_rmr:
         man["controls"][0]["message_receives_rmr_type"] = "DARKNESS"
-    monkeypatch.setattr("a1.utils.get_ric_manifest", lambda: man)
 
-    # patch rmr mapping
-    mapping = open(_get_fixture_path("rmr_string_int_mapping.txt"), "r").readlines()
-    monkeypatch.setattr("a1.utils._get_rmr_mapping_table", lambda: mapping)
+    if nofetch:
+        del man["controls"][0]["control_state_request_rmr_type"]
+
+    monkeypatch.setattr("a1.utils.get_ric_manifest", lambda: man)
 
 
 def good_payload():