def test_process_response_zipstr_no_packages(self): task = self._create_task() api = self._create_instance(task) response = DummyResponse() response.status_code = 200 response.text = retrieve_result.format(zip=CreatePackageZipBuilder( "testing", api.api_version)(), extra="") resp = api._process_response(response) self.assertEqual(resp, {})
def test_process_response_zipstr_no_packages(self): task = self._create_task() api = self._create_instance(task) response = Response() response.status_code = 200 response.raw = io.BytesIO( retrieve_result.format( zip=CreatePackageZipBuilder("testing", api.api_version).as_base64(), extra="", ).encode()) resp = api._process_response(response) self.assertEqual(resp, {})
def _process_response_zipstr_no_packages(self): task = self._create_task() api = self._create_instance(task) response = DummyResponse response.status_code = 200 response.content = deploy_result.format( zip = CreatePackageZipBuilder('testing'), extra = '', ) resp = api._process_response(response) self.assertEquals( resp, {}, )
def _get_api(self, path=None): package_zip = CreatePackageZipBuilder(self.options['package'], self.options['api_version']) return self.api_class(self, package_zip(), purge_on_delete=False)
def test_init__missing_api_version(self): with self.assertRaises(ValueError): CreatePackageZipBuilder("TestPackage", None)
def test_init__missing_name(self): with self.assertRaises(ValueError): CreatePackageZipBuilder(None, "43.0")
def _get_package_zip(self, path=None): return CreatePackageZipBuilder( self.options["package"], self.options["api_version"] ).as_base64()