def setUp(self): #Create the json message #PullPath request self.d_server = '{ "action": "pullPath", \ "meta": { \ "remote": { \ "key": "121215" \ }, \ "local": { \ "path": "/tmp/localstore" \ }, \ "transport": { \ "mechanism": "compress", \ "compress": { \ "encoding": "base64", \ "archive": "zip", \ "unpack": true, \ "cleanup": true \ } \ } \ } \ }' self.storeObject = mount_dir.MountDir(test=True) self.Path = '/tmp/share/key-121215' self.storeObject.path = 'some path' self.d_ret = {'some': 'dictionary'}
def setUp(self): #Create the json message """ PushPath request= '{ "action": "pushPath", \ "meta": { \ "remote": { \ "key": "121215" \ }, \ "local": { \ "path": "/tmp/datadir" \ }, \ "transport": { \ "mechanism": "compress", \ "compress": { \ "archive": "zip", \ "unpack": true, \ "cleanup": true \ } \ } \ } \ }' """ self.storeObject = mount_dir.MountDir(test=True) self.length = 1660 self.data = b'--------------------------ab333d11461fc3e3\r\nContent-Disposition: form-data; name="local"; filename="81d9a05a-4eff-4c8a-9de4-930dab3fc32b.zip.b64"\r\nContent-Type: application/octet-stream\r\n\r\nUEsDBBQAAAAIAHN2AkuemRG8BwAAAAUAAAANAAAAZGF0YWRpci8yLnR4dMvMUzDiAgBQSwMEFAAAAAgAqG4CS13KPJcHAAAABQAAAA0AAABkYXRhZGlyLzEudHh0y8xTMOQCAFBLAwQUAAAACACFdgJL36gKpQcAAAAFAAAAEgAAAGRhdGFkaXIvZGF0YS8zLnR4dMvMUzDmAgBQSwMEFAAAAAgAmXYCS88IW5JZAAAAmwAAADUAAABkYXRhZGlyL2RhdGEvODFkOWEwNWEtNGVmZi00YzhhLTlkZTQtOTMwZGFiM2ZjMzJiLnppcAvwZmYRYWBg4GAoLmPynjdTcA87kMcKxLxAnJJYkpiSWaRvpFdSUXL6TLDBIyaGALiOFXlM3rGnbKZj02EI0/EEWUcr0I77K7iWwnQIIekA0frGMG3PmBgAUEsBAhQDFAAAAAgAc3YCS56ZEbwHAAAABQAAAA0AAAAAAAAAAAAAALSBAAAAAGRhdGFkaXIvMi50eHRQSwECFAMUAAAACACobgJLXco8lwcAAAAFAAAADQAAAAAAAAAAAAAAtIEyAAAAZGF0YWRpci8xLnR4dFBLAQIUAxQAAAAIAIV2AkvfqAqlBwAAAAUAAAASAAAAAAAAAAAAAAC0gWQAAABkYXRhZGlyL2RhdGEvMy50eHRQSwECFAMUAAAACACZdgJLzwhbklkAAACbAAAANQAAAAAAAAAAAAAAtIGbAAAAZGF0YWRpci9kYXRhLzgxZDlhMDVhLTRlZmYtNGM4YS05ZGU0LTkzMGRhYjNmYzMyYi56aXBQSwUGAAAAAAQABAAZAQAARwEAAAAA\r\n--------------------------ab333d11461fc3e3\r\nContent-Disposition: form-data; name="d_msg"\r\n\r\n{"meta": {"local": {"path": "/tmp/datadir"}, "transport": {"checkRemote": false, "compress": {"unpack": true, "cleanup": true, "archive": "zip"}, "mechanism": "compress"}, "remote": {"key": "121215"}}, "action": "pushPath"}\r\n--------------------------ab333d11461fc3e3\r\nContent-Disposition: form-data; name="filename"\r\n\r\n81d9a05a-4eff-4c8a-9de4-930dab3fc32b.zip.b64\r\n--------------------------ab333d11461fc3e3--\r\n' self.form = 'FieldStorage(None, None, [FieldStorage(\'local\', \'7d97663b-191d-4175-a9dd-5bf28a6803c2.zip.b64\', b\'UEsDBBQAAAAIAHqDCUuemRG8BwAAAAUAAAANAAAAZGF0YWRpci8yLnR4dMvMUzDiAgBQSwMEFAAAAAgAeIMJS13KPJcHAAAABQAAAA0AAABkYXRhZGlyLzEudHh0y8xTMOQCAFBLAwQUAAAACABOhwlLNpTSE0MAAABkAAAANQAAAGRhdGFkaXIvZGF0YS83ZDk3NjYzYi0xOTFkLTQxNzUtYTlkZC01YmYyOGE2ODAzYzIuemlwC/BmZhFhYGDgYKhq5vSeN1NwDzuQxwrEvECckliSmJJZpG+kV1JRcvpMsMEjJoYAuI4KoI7YUzbTsekwhOl4wsQAAFBLAwQUAAAACACEgwlL36gKpQcAAAAFAAAAEgAAAGRhdGFkaXIvZGF0YS8zLnR4dMvMUzDmAgBQSwECFAMUAAAACAB6gwlLnpkRvAcAAAAFAAAADQAAAAAAAAAAAAAAtIEAAAAAZGF0YWRpci8yLnR4dFBLAQIUAxQAAAAIAHiDCUtdyjyXBwAAAAUAAAANAAAAAAAAAAAAAAC0gTIAAABkYXRhZGlyLzEudHh0UEsBAhQDFAAAAAgATocJSzaU0hNDAAAAZAAAADUAAAAAAAAAAAAAALSBZAAAAGRhdGFkaXIvZGF0YS83ZDk3NjYzYi0xOTFkLTQxNzUtYTlkZC01YmYyOGE2ODAzYzIuemlwUEsBAhQDFAAAAAgAhIMJS9+oCqUHAAAABQAAABIAAAAAAAAAAAAAALSB+gAAAGRhdGFkaXIvZGF0YS8zLnR4dFBLBQYAAAAABAAEABkBAAAxAQAAAAA=\'), FieldStorage(\'d_msg\', None, \'{"action": "pushPath", "meta": {"remote": {"key": "121215"}, "local": {"path": "/tmp/datadir"}, "transport": {"compress": {"cleanup": true, "unpack": true, "archive": "zip"}, "mechanism": "compress", "checkRemote": false}}}\'), FieldStorage(\'filename\', None, \'7d97663b-191d-4175-a9dd-5bf28a6803c2.zip.b64\')])\'' self.d_form = {'d_msg': '{"meta": {"local": {"path": "/tmp/datadir"}, "transport": {"compress": {"cleanup": true, "archive": "zip", "unpack": true}, "checkRemote": false, "mechanism": "compress"}, "remote": {"key": "121215"}}, "action": "pushPath"}', 'filename': 'a573d22f-2621-4174-827b-2b91798d6007.zip.b64', 'local': b'UEsDBBQAAAAIAHN2AkuemRG8BwAAAAUAAAANAAAAZGF0YWRpci8yLnR4dMvMUzDiAgBQSwMEFAAAAAgAqG4CS13KPJcHAAAABQAAAA0AAABkYXRhZGlyLzEudHh0y8xTMOQCAFBLAwQUAAAACACFdgJL36gKpQcAAAAFAAAAEgAAAGRhdGFkaXIvZGF0YS8zLnR4dMvMUzDmAgBQSwMEFAAAAAgA0nkCS88IW5JZAAAAmwAAADUAAABkYXRhZGlyL2RhdGEvYTU3M2QyMmYtMjYyMS00MTc0LTgyN2ItMmI5MTc5OGQ2MDA3LnppcAvwZmYRYWBg4GAoLmPynjdTcA87kMcKxLxAnJJYkpiSWaRvpFdSUXL6TLDBIyaGALiOFXlM3rGnbKZj02EI0/EEWUcr0I77K7iWwnQIIekA0frGMG3PmBgAUEsBAhQDFAAAAAgAc3YCS56ZEbwHAAAABQAAAA0AAAAAAAAAAAAAALSBAAAAAGRhdGFkaXIvMi50eHRQSwECFAMUAAAACACobgJLXco8lwcAAAAFAAAADQAAAAAAAAAAAAAAtIEyAAAAZGF0YWRpci8xLnR4dFBLAQIUAxQAAAAIAIV2AkvfqAqlBwAAAAUAAAASAAAAAAAAAAAAAAC0gWQAAABkYXRhZGlyL2RhdGEvMy50eHRQSwECFAMUAAAACADSeQJLzwhbklkAAACbAAAANQAAAAAAAAAAAAAAtIGbAAAAZGF0YWRpci9kYXRhL2E1NzNkMjJmLTI2MjEtNDE3NC04MjdiLTJiOTE3OThkNjAwNy56aXBQSwUGAAAAAAQABAAZAQAARwEAAAAA'} self.filename = '/tmp/share/key-121215/datadir.zip' self.filecontent = b'PK\x03\x04\x14\x00\x00\x00\x08\x00sv\x02K\x9e\x99\x11\xbc\x07\x00\x00\x00\x05\x00\x00\x00\r\x00\x00\x00datadir/2.txt\xcb\xccS0\xe2\x02\x00PK\x03\x04\x14\x00\x00\x00\x08\x00\xa8n\x02K]\xca<\x97\x07\x00\x00\x00\x05\x00\x00\x00\r\x00\x00\x00datadir/1.txt\xcb\xccS0\xe4\x02\x00PK\x03\x04\x14\x00\x00\x00\x08\x005}\x02K\x0b h\x18D\x00\x00\x00d\x00\x00\x005\x00\x00\x00datadir/data/786dcffd-5a0d-4e17-9c9d-4e0ccc69ab6d.zip\x0b\xf0ff\x11a``\xe0`(.c\xf2\x9e7Sp\x0f;\x90\xc7\n\xc4\xbc@\x9c\x92X\x92\x98\x92Y\xa4o\xa4WRQr\xfaL\xb0\xc1#&\x86\x00\xb8\x8e\x15yL\xde\xb1\xa7l\xa6c\xd3a\x08\xd3\xf1\x84\x89\x01\x00PK\x03\x04\x14\x00\x00\x00\x08\x00\x85v\x02K\xdf\xa8\n\xa5\x07\x00\x00\x00\x05\x00\x00\x00\x12\x00\x00\x00datadir/data/3.txt\xcb\xccS0\xe6\x02\x00PK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00sv\x02K\x9e\x99\x11\xbc\x07\x00\x00\x00\x05\x00\x00\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x81\x00\x00\x00\x00datadir/2.txtPK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00\xa8n\x02K]\xca<\x97\x07\x00\x00\x00\x05\x00\x00\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x812\x00\x00\x00datadir/1.txtPK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x005}\x02K\x0b h\x18D\x00\x00\x00d\x00\x00\x005\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x81d\x00\x00\x00datadir/data/786dcffd-5a0d-4e17-9c9d-4e0ccc69ab6d.zipPK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00\x85v\x02K\xdf\xa8\n\xa5\x07\x00\x00\x00\x05\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x81\xfb\x00\x00\x00datadir/data/3.txtPK\x05\x06\x00\x00\x00\x00\x04\x00\x04\x00\x19\x01\x00\x002\x01\x00\x00\x00\x00' self.storeObject.headers = {'Content-Type' : 'some type', 'Content-length' : 1660, 'user-agent' : 'PycURL/7.43.0 libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3'} self.Path = '/tmp/share/key-121215' self.d_msg = {'meta': {'remote': {'key': '121215'}, 'local': {'path': '/tmp/datadir'}, 'transport': {'mechanism': 'compress', 'compress': {'cleanup': True, 'unpack': True, 'archive': 'zip'}, 'checkRemote': False}}, 'action': 'pushPath'} self.d_ret = {'decode': {'msg': 'base64 decode successful!', 'status': True}, 'write': {}}