예제 #1
0
 def setUp(self):
     self.hashtag = hashtag()
     self.author = User.objects.get(username='******')
     self.addon = Package.objects.get(name='test-addon',
                                      author__username='******')
     self.library = Package.objects.get(name='test-library')
     self.addonrev = self.addon.latest
     self.librev = self.library.latest
     mod = Module.objects.create(
         filename='test_module',
         code='// test module',
         author=self.author
     )
     self.librev.module_add(mod)
     self.SDKDIR = tempfile.mkdtemp()
     self.attachment_file_name = os.path.join(
             settings.UPLOAD_DIR, 'test_filename.txt')
     handle = open(self.attachment_file_name, 'w')
     handle.write('.')
     handle.close()
     # link core to the latest SDK
     self.createCore()
     settings.XPI_AMO_PREFIX = "file://%s" % os.path.join(
             settings.ROOT, 'apps/xpi/tests/sample_addons/')
     self.target_basename = os.path.join(
             settings.XPI_TARGETDIR, self.hashtag)
     self.backup_get_source_dir = SDK.get_source_dir
     SDK.get_source_dir = Mock(return_value=os.path.join(
         settings.ROOT, 'lib', settings.TEST_SDK))
예제 #2
0
 def setUp(self):
     self.hashtag = hashtag()
     self.author = User.objects.get(username='******')
     self.addon = Package.objects.get(name='test-addon',
                                      author__username='******')
     self.library = Package.objects.get(name='test-library')
     self.addonrev = self.addon.latest
     self.librev = self.library.latest
     mod = Module.objects.create(filename='test_module',
                                 code='// test module',
                                 author=self.author)
     self.librev.module_add(mod)
     self.SDKDIR = tempfile.mkdtemp()
     self.attachment_file_name = os.path.join(settings.UPLOAD_DIR,
                                              'test_filename.txt')
     handle = open(self.attachment_file_name, 'w')
     handle.write('.')
     handle.close()
     # link core to the latest SDK
     self.createCore()
     settings.XPI_AMO_PREFIX = "file://%s" % os.path.join(
         settings.ROOT, 'apps/xpi/tests/sample_addons/')
     self.target_basename = os.path.join(settings.XPI_TARGETDIR,
                                         self.hashtag)
     self.backup_get_source_dir = SDK.get_source_dir
     SDK.get_source_dir = Mock(
         return_value=os.path.join(settings.ROOT, 'lib', settings.TEST_SDK))
예제 #3
0
 def setUp(self):
     self.author = User.objects.get(username='******')
     self.addon = self.author.packages_originated.addons()[0:1].get()
     self.library = self.author.packages_originated.libraries()[0:1].get()
     self.hashtag = hashtag()
     self.xpi_file = os.path.join(settings.XPI_TARGETDIR,
             "%s.xpi" % self.hashtag)
예제 #4
0
 def setUp(self):
     self.hashtag = hashtag()
     self.check_download_url = reverse('jp_check_download_xpi',
                                       args=[self.hashtag])
     self.prepare_test_url = reverse('jp_addon_revision_test', args=[205])
     self.xpi_path = os.path.join(settings.XPI_TARGETDIR,
                                  '%s.xpi' % self.hashtag)
예제 #5
0
 def setUp(self):
     self.hashtag = hashtag()
     self.check_download_url = reverse('jp_check_download_xpi',
             args=[self.hashtag])
     self.prepare_test_url = reverse('jp_addon_revision_test',
             args=['1000003', 0])
     self.xpi_path = os.path.join(
         settings.XPI_TARGETDIR, '%s.xpi' % self.hashtag)
예제 #6
0
 def setUp(self):
     self.author = User.objects.get(username='******')
     self.addonrev = Package.objects.get(name='test-addon',
                                      author__username='******').latest
     self.hashtag = hashtag()
     self.amo = AMOOAuth(domain=settings.AMOOAUTH_DOMAIN,
                        port=settings.AMOOAUTH_PORT,
                        protocol=settings.AMOOAUTH_PROTOCOL,
                        prefix=settings.AMOOAUTH_PREFIX)
예제 #7
0
 def setUp(self):
     self.author = User.objects.get(username='******')
     self.addon = self.author.packages_originated.addons()[0:1].get()
     self.library = self.author.packages_originated.libraries()[0:1].get()
     self.hashtag = hashtag()
     self.xpi_file = os.path.join(settings.XPI_TARGETDIR,
             "%s.xpi" % self.hashtag)
     self.zip_file = os.path.join(settings.XPI_TARGETDIR,
             "%s.zip" % self.hashtag)
     self.temp_dir = tempfile.mkdtemp()
예제 #8
0
 def setUp(self):
     self.xpi_file_prefix = "file://%s" % os.path.join(
         settings.ROOT, 'apps/xpi/tests/sample_addons/')
     self.sample_addons = [
         "sample_add-on-1.0b3", "sample_add-on-1.0b4",
         "sample_add-on-1.0rc2.xpi"
     ]
     self.sdk_source_dir = settings.REPACKAGE_SDK_SOURCE or os.path.join(
         settings.ROOT, 'lib/addon-sdk-1.0rc2')
     self.hashtag = hashtag()
     self.target_basename = os.path.join(settings.XPI_TARGETDIR,
                                         self.hashtag)
예제 #9
0
 def setUp(self):
     self.xpi_file_prefix = "file://%s" % os.path.join(
             settings.ROOT, 'apps/xpi/tests/sample_addons/')
     self.sample_addons = [
             "sample_add-on-1.0b3",
             "sample_add-on-1.0b4",
             "sample_add-on-1.0rc2.xpi"]
     self.sdk_source_dir = settings.REPACKAGE_SDK_SOURCE or os.path.join(
             settings.ROOT, 'lib/addon-sdk-1.0rc2')
     self.hashtag = hashtag()
     self.target_basename = os.path.join(
             settings.XPI_TARGETDIR, self.hashtag)
예제 #10
0
 def setUp(self):
     self.hashtag = hashtag()
     self.file_prefix = os.path.join(settings.ROOT,
             'apps/xpi/tests/sample_addons/')
     self.xpi_file_prefix = "file://%s" % self.file_prefix
     self.sample_addons = [
             "sample_add-on-1.0b3.xpi",
             "sample_add-on-1.0b4.xpi",
             "sample_add-on-1.0rc2.xpi",
             "repackage-special_name.xpi",
             "google_documents_viewer-0.10-fx.xpi"]
     self.sdk_source_dir = settings.REPACKAGE_SDK_SOURCE or os.path.join(
             settings.ROOT, 'lib/addon-sdk-1.0rc2')
예제 #11
0
 def setUp(self):
     self.hashtag = hashtag()
     self.xpi_file = os.path.join(settings.XPI_TARGETDIR,
             "%s.xpi" % self.hashtag)
     self.zip_file = os.path.join(settings.XPI_TARGETDIR,
             "%s.zip" % self.hashtag)
예제 #12
0
 def setUp(self):
     self.hashtag = hashtag()
     self.author = User.objects.get(username='******')
     self.addon = self.author.packages_originated.addons()[0:1].get()
     self.core_sdk = SDK.objects.latest('pk')
     self.createTestSDK()
예제 #13
0
 def setUp(self):
     self.hashtag = hashtag()
     self.check_download_url = reverse('jp_check_download_xpi',
             args=[self.hashtag])
예제 #14
0
 def setUp(self):
     self.hashtag = hashtag()
예제 #15
0
 def setUp(self):
     self.hashtag = hashtag()
     self.xpi_file = os.path.join(settings.XPI_TARGETDIR,
                                  "%s.xpi" % self.hashtag)
     self.zip_file = os.path.join(settings.XPI_TARGETDIR,
                                  "%s.zip" % self.hashtag)
예제 #16
0
 def setUp(self):
     self.hashtag = hashtag()
     self.check_download_url = reverse('jp_check_download_xpi',
                                       args=[self.hashtag])
예제 #17
0
 def setUp(self):
     self.hashtag = hashtag()
예제 #18
0
 def setUp(self):
     self.hashtag = hashtag()
     self.author = User.objects.get(username='******')
     self.addon = self.author.packages_originated.addons()[0:1].get()
     self.core_sdk = SDK.objects.latest('pk')
     self.createTestSDK()