コード例 #1
0
 def _create_sample_wheel(self, package_name, package_version):
     package_src = '{0}=={1}'.format(package_name,
                                     package_version)
     wagon_client = Wagon(package_src)
     return wagon_client.create(
         archive_destination_dir=tempfile.mkdtemp(dir=self.workdir),
         force=True)
コード例 #2
0
 def _put_n_plugins(self, number_of_plugins):
     for i in range(0, number_of_plugins):
         tmpdir = tempfile.mkdtemp(prefix='test-pagination-')
         with open(os.path.join(tmpdir, 'setup.py'), 'w') as f:
             f.write('from setuptools import setup\n')
             f.write('setup(name="some-package", version={0})'.format(i))
         wagon = Wagon(tmpdir)
         plugin_path = wagon.create(archive_destination_dir=tmpdir)
         self.post_file('/plugins', plugin_path)
         shutil.rmtree(tmpdir)
コード例 #3
0
 def _put_n_plugins(self, number_of_plugins):
     for i in range(0, number_of_plugins):
         tmpdir = tempfile.mkdtemp(prefix='test-pagination-')
         with open(os.path.join(tmpdir, 'setup.py'), 'w') as f:
             f.write('from setuptools import setup\n')
             f.write('setup(name="some-package", version={0})'.format(i))
         wagon = Wagon(tmpdir)
         plugin_path = wagon.create(archive_destination_dir=tmpdir)
         self.post_file('/plugins', plugin_path)
         shutil.rmtree(tmpdir)
コード例 #4
0
 def test_plugins_pagination(self):
     for i in range(1, 11):
         tmpdir = tempfile.mkdtemp(prefix='test-pagination-')
         with open(os.path.join(tmpdir, 'setup.py'), 'w') as f:
             f.write('from setuptools import setup\n')
             f.write('setup(name="some-package", version={0})'.format(i))
         wagon = Wagon(tmpdir)
         plugin_path = wagon.create(archive_destination_dir=tmpdir)
         self.client.plugins.upload(plugin_path)
         shutil.rmtree(tmpdir)
     self._test_pagination(self.client.plugins.list)
コード例 #5
0
 def test_plugins_pagination(self):
     for i in range(1, 11):
         tmpdir = tempfile.mkdtemp(prefix='test-pagination-')
         with open(os.path.join(tmpdir, 'setup.py'), 'w') as f:
             f.write('from setuptools import setup\n')
             f.write('setup(name="some-package", version={0})'.format(i))
         wagon = Wagon(tmpdir)
         plugin_path = wagon.create(archive_destination_dir=tmpdir)
         self.client.plugins.upload(plugin_path)
         shutil.rmtree(tmpdir)
     self._test_pagination(self.client.plugins.list)
コード例 #6
0
 def _create_wheel(self, package_name, package_version):
     module_src = '{0}=={1}'.format(package_name, package_version)
     wagon_client = Wagon(module_src)
     return wagon_client.create(
         archive_destination_dir=tempfile.gettempdir(),
         force=True)
コード例 #7
0
ファイル: base_test.py プロジェクト: tsznuk/cloudify-manager
 def create_wheel(self, package_name, package_version):
     module_src = '{0}=={1}'.format(package_name, package_version)
     wagon_client = Wagon(module_src)
     return wagon_client.create(
         archive_destination_dir=tempfile.gettempdir(), force=True)
コード例 #8
0
 def _create_test_wagon(self, plugin_name):
     source_dir = resource('plugins/{0}'.format(plugin_name))
     target_dir = tempfile.mkdtemp(dir=self.workdir)
     wagon_client = Wagon(source_dir)
     return wagon_client.create(archive_destination_dir=target_dir,
                                force=True)
 def _create_sample_wheel(self):
     src = util.get_resource_path('plugins/{0}'.format(TEST_PACKAGE_NAME))
     wagon_client = Wagon(src)
     return wagon_client.create(
         archive_destination_dir=tempfile.mkdtemp(dir=self.workdir),
         force=True)
コード例 #10
0
 def _create_sample_wheel(self, package_name, package_version):
     package_src = '{0}=={1}'.format(package_name, package_version)
     wagon_client = Wagon(package_src)
     return wagon_client.create(
         archive_destination_dir=tempfile.mkdtemp(dir=self.workdir),
         force=True)