def test_name_is_unique_for_each_distro(self): # Script instances for different distros get different names. self.assertNotEqual( GenerateContentsFiles( test_args=['-d', self.factory.makeDistribution().name]).name, GenerateContentsFiles( test_args=['-d', self.factory.makeDistribution().name]).name)
def makeScript(self, distribution=None, run_setup=True): """Create a script for testing.""" if distribution is None: distribution = self.makeDistro() script = GenerateContentsFiles(test_args=['-d', distribution.name]) script.logger = DevNullLogger() script.txn = FakeTransaction() if run_setup: script.setUp() else: script.distribution = distribution return script
def makeScript(self, distribution=None, run_setup=True): """Create a script for testing.""" if distribution is None: distribution = self.makeDistro() script = GenerateContentsFiles(test_args=['-d', distribution.name]) script.logger = DevNullLogger() script.txn = FakeTransaction() if run_setup: script.setUp() else: script.distribution = distribution return script
#!/usr/bin/python -S # # Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Master distro publishing script.""" import _pythonpath from lp.archivepublisher.scripts.generate_contents_files import ( GenerateContentsFiles, ) if __name__ == '__main__': script = GenerateContentsFiles( "generate-contents", dbuser='******') script.lock_and_run()
#!/usr/bin/python -S # # Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Master distro publishing script.""" import _pythonpath from lp.archivepublisher.scripts.generate_contents_files import ( GenerateContentsFiles, ) if __name__ == '__main__': script = GenerateContentsFiles("generate-contents", dbuser='******') script.lock_and_run()
def test_requires_real_distro(self): # An incorrect distribution name is flagged as an invalid option # value. script = GenerateContentsFiles( test_args=['-d', self.factory.getUniqueString()]) self.assertRaises(OptionValueError, script.processOptions)
def test_requires_distro(self): # The --distribution or -d argument is mandatory. script = GenerateContentsFiles(test_args=[]) self.assertRaises(OptionValueError, script.processOptions)
def test_name_is_consistent(self): # Script instances for the same distro get the same name. distro = self.factory.makeDistribution() self.assertEqual( GenerateContentsFiles(test_args=['-d', distro.name]).name, GenerateContentsFiles(test_args=['-d', distro.name]).name)