diff options
author | Liam Fallon <liam.fallon@est.tech> | 2021-11-22 09:27:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-11-22 09:27:23 +0000 |
commit | 226d4c344baa504d90ba7a3a4f3e17733ebc1df8 (patch) | |
tree | ea106a86cb5bf7cdd48a9915ecf84f6420cd84f7 /runtime/src/test/resources/http-cache | |
parent | f0a58426aa87795d4fa29eedb5bf2c14f5f6896f (diff) | |
parent | a72ce28fb60c1903ed3ef3da6bb3faac1ae801ba (diff) |
Merge "Added Camel Unit Tests"
Diffstat (limited to 'runtime/src/test/resources/http-cache')
-rw-r--r-- | runtime/src/test/resources/http-cache/third_party_proxy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/src/test/resources/http-cache/third_party_proxy.py b/runtime/src/test/resources/http-cache/third_party_proxy.py index 5c80cdda4..67af21470 100644 --- a/runtime/src/test/resources/http-cache/third_party_proxy.py +++ b/runtime/src/test/resources/http-cache/third_party_proxy.py @@ -331,6 +331,15 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): jsonGenerated = "{\"controlLoopList\": [{\"name\": \"PMSHInstance0\",\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\",\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}"; self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True + elif (self.path.startswith("/onap/controlloop/v2/instanceProperties")) and http_type == "POST": + print("self.path start with POST /onap/controlloop/v2/instanceProperties, copying body to response ...") + if not os.path.exists(cached_file_folder): + os.makedirs(cached_file_folder, 0o777) + with open(cached_file_header, 'w+') as f: + f.write("{\"Content-Length\": \"" + str(len(self.data_string)) + "\", \"Content-Type\": \""+str(self.headers['Content-Type'])+"\"}") + with open(cached_file_content, 'w+') as f: + f.write(self.data_string) + return True else: return False |