def _test_deCodeFileContent(self): # Generate file content file_content = "test_data".encode('utf-8') file_content = zlib.compress(file_content) file_content = base64.b64encode(file_content) file_content = file_content.decode('utf-8') data_dict = { "merId": "888888888888888", "batchNo": "123456", "txnTime": 1234323223, "fileName": "test.txt", "fileContent": file_content, } SDKUtil.deCodeFileContent(data_dict, SDKConfig().fileDir)
def test_enCodeFileContent(self): file_content = "test_data".encode('utf-8') file_content = zlib.compress(file_content) file_content = base64.b64encode(file_content) file_content = file_content.decode('utf-8') data_dict = { "merId": "888888888888888", "batchNo": "123456", "txnTime": 1234323223, "fileName": "test.txt", "fileContent": file_content, } SDKUtil.deCodeFileContent(data_dict, SDKConfig().fileDir) encode_str = SDKUtil.enCodeFileContent(SDKConfig().fileDir + "test.txt") self.assertEqual(encode_str, "eJwrSS0uiU9JLEkEABL5A7o=")
def deCodeFileContent(params, fileDirectory): return SDKUtil.deCodeFileContent(params, fileDirectory)