Exemplo n.º 1
0
def test_zip_to_binary_and_back():
    package_file = open('tests/resources/zip_binary.txt')
    zip_contents = package_file.read().replace("\n", "")
    zip_contents = zip_contents.replace('"', '')
    utils.binary_to_zip(zip_contents)
    return_binary = utils.zip_to_binary('retrieve.zip')

    assert zip_contents == return_binary
Exemplo n.º 2
0
def test_zip_to_binary():
    test_file = open('test.txt', 'w')
    test_file.write('testing')
    test_file.close()
    zipped = zipfile.ZipFile('test.zip', 'w')
    zipped.write('test.txt')
    zipped.close()

    enc_file = utils.zip_to_binary('test.zip')

    assert enc_file
Exemplo n.º 3
0
    def deploy(self, file_path, **kwargs):
        self._setHeaders('retrieve')
        deploy_options = self._client.factory.create('DeployOptions')
        deploy_options.allowMissingFiles = False
        deploy_options.autoUpdatePackage = False
        deploy_options.checkOnly = False
        deploy_options.ignoreWarnings = False
        deploy_options.performRetrieve = False
        deploy_options.purgeOnDelete = False
        deploy_options.rollbackOnError = True
        deploy_options.runAllTests = False
        deploy_options.runTests = []
        deploy_options.singlePackage = True
        if kwargs:
            for k, v in kwargs.iteritems():
                    if k in deploy_options.__keylist__:
                        deploy_options.__setattr__(k, v)

        res = self._client.service.deploy(zip_to_binary(file_path), deploy_options)
        return res