def test_lgpl_write(self): """Tests write of a LicenceChoice with license set to "LGPL" """ skel = LicenseChoice( author='Damien Lebrun', project_name='Foo', license='LGPL' ) with TempDir() as tmp: skel.write(tmp.path) self.assertTrue(tmp.exists('LICENSE')) self.assertTrue(tmp.exists('COPYING')) self.assertTrue(tmp.exists('COPYING.LESSER'))
def test_lgpl_run(self): """Tests run of a LicenceChoice with license set to "LGPL" """ resps = ['Foo', 'Damien Lebrun', '*****@*****.**', 'LGPL', ] self.input_mock.side_effect = lambda x: resps.pop(0) skel = LicenseChoice() with TempDir() as tmp: skel.run(tmp.path) self.assertTrue(tmp.exists('LICENSE')) self.assertTrue(tmp.exists('COPYING')) self.assertTrue(tmp.exists('COPYING.LESSER'))
def test_bsd_licence_skel(self): """Tests for a BSD license_ske property""" skel = LicenseChoice( author='Damien Lebrun', project_name='Foo', license='BSD' ) self.assertTrue(isinstance(skel.license_skel, BSD))
def test_lgpl_write_fails(self): """Tests write of a LicenceChoice fails if a key is missing """ skel = LicenseChoice(author='Damien Lebrun', license='LGPL') with TempDir() as tmp: self.assertRaises(KeyError, skel.write, tmp.path)
def test_lgpl_licence_skel(self): """Tests for a LGPL license_ske property""" skel = LicenseChoice( author='Damien Lebrun', project_name='Foo', license='LGPL' ) self.assertTrue(isinstance(skel.license_skel, LGPL))
def test_licence_skel_default(self): """Tests the default license_ske property""" skel = LicenseChoice(author='Damien Lebrun', project_name='Foo') self.assertTrue(isinstance(skel.license_skel, NoLicense)) self.assertEqual(skel.license_skel['author'], 'Damien Lebrun')