Ejemplo n.º 1
0
 def test_create_library_from_archive(self):
     path_library = os.path.join(
             settings.ROOT, 'apps/jetpack/tests/sample_library.zip')
     library = create_from_archive(path_library, self.author, 'l')
     self.failUnless(library)
     for att in library.latest.attachments.all():
         self.failUnless(os.path.isfile(
             os.path.join(settings.UPLOAD_DIR, att.path)))
     self.failUnless('lib' in [m.filename
         for m in library.latest.modules.all()])
     self.failUnless(('attachment', 'txt') in [(a.filename, a.ext)
         for a in library.latest.attachments.all()])
Ejemplo n.º 2
0
 def test_create_adddon_from_archive(self):
     path_addon = os.path.join(
             settings.ROOT, 'apps/jetpack/tests/sample_addon.zip')
     addon = create_from_archive(path_addon, self.author, 'a')
     self.failUnless(addon)
     for att in addon.latest.attachments.all():
         self.failUnless(os.path.isfile(
             os.path.join(settings.UPLOAD_DIR, att.path)))
     self.failUnless(
             'main' in [m.filename for m in addon.latest.modules.all()])
     self.failUnless(('attachment', 'txt') in [(a.filename, a.ext)
         for a in addon.latest.attachments.all()])
Ejemplo n.º 3
0
 def test_create_library_from_archive(self):
     path_library = os.path.join(settings.ROOT,
                                 'apps/jetpack/tests/sample_library.zip')
     library = create_from_archive(path_library, self.author, 'l')
     self.failUnless(library)
     for att in library.latest.attachments.all():
         self.failUnless(
             os.path.isfile(os.path.join(settings.UPLOAD_DIR, att.path)))
     self.failUnless(
         'lib' in [m.filename for m in library.latest.modules.all()])
     self.failUnless(('attachment',
                      'txt') in [(a.filename, a.ext)
                                 for a in library.latest.attachments.all()])
Ejemplo n.º 4
0
 def test_create_adddon_from_archive(self):
     path_addon = os.path.join(settings.ROOT,
                               'apps/jetpack/tests/sample_addon.zip')
     addon = create_from_archive(path_addon, self.author, 'a')
     self.failUnless(addon)
     for att in addon.latest.attachments.all():
         self.failUnless(
             os.path.isfile(os.path.join(settings.UPLOAD_DIR, att.path)))
     self.failUnless(
         'main' in [m.filename for m in addon.latest.modules.all()])
     self.failUnless(('attachment',
                      'txt') in [(a.filename, a.ext)
                                 for a in addon.latest.attachments.all()])