~ubuntu-langpack/langpack-o-matic/main

« back to all changes in this revision

Viewing changes to test/import

  • Committer: Martin Pitt
  • Date: 2015-10-06 09:13:29 UTC
  • Revision ID: martin.pitt@canonical.com-20151006091329-0cd72ee9mm36mrhc
Fix discarding with custom classes

Don't let a subsequent --class import discard langpacks from a previous run
which was not for this class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
    def test_custom_class_treshold(self):
302
302
        '''custom --class, with completeness treshold'''
303
303
 
 
304
        # add a general -zh langpack; the lpomtest-zh class package should be
 
305
        # discarded, but not this one from an unrelated run
 
306
        general_zh_pkg = os.path.join(self.outdir, 'sources-update', 'language-pack-zh')
 
307
        with open(self.updated_packages, 'w') as f:
 
308
            f.write(general_zh_pkg + '\n')
 
309
        os.makedirs(general_zh_pkg)
 
310
 
304
311
        pkglist = os.path.join(self.outdir, 'pkglist')
305
312
        with open(pkglist, 'w') as f:
306
313
            f.write('postgresql-8.4\ngnome-session\nsomeotherpackage\n')
347
354
            self.assertFalse(os.path.exists(os.path.join(
348
355
                self.outdir, 'sources-lpomtest/language-pack-lpomtest-%s' % lang)))
349
356
 
 
357
        # should not have removed our unrelated general -zh langpack
 
358
        self.assertTrue(os.path.exists(general_zh_pkg))
 
359
        self.assertIn('language-pack-zh\n', updated)
 
360
 
350
361
    def test_deb_validity(self):
351
362
        '''Source and binary deb validity'''
352
363