def test_create_project_template(self): template = ProjectTemplate._create_project_template('fooproject') self.assertEqual('fooproject', template.name) self.assertEqual('0.0.0', template.version) self.assertEqual('The fooproject project', template.description) self.assertEqual([], template.alpine_deps) self.assertEqual([], template.authors) self.assertEqual(1, len(template.maintainers)) self.assertIsNotNone(template.maintainers[0].email) self.assertEqual([], template.urls) # with args template = ProjectTemplate._create_project_template( 'fooproject', description='foo_desc', licenses=['a', 'b'], maintainer_names=['John Doe', 'Rishabh'], author_names=['Pragyan'], version='1.2.3', alpine_deps=['foobar', 'baz']) self.assertEqual('fooproject', template.name) self.assertEqual('1.2.3', template.version) self.assertEqual('foo_desc', template.description) self.assertEqual(['baz', 'foobar'], template.alpine_deps) self.assertEqual(1, len(template.authors)) self.assertEqual('John Doe', template.maintainers[0].name) self.assertEqual('Rishabh', template.maintainers[1].name) self.assertEqual('Pragyan', template.authors[0].name) self.assertEqual(2, len(template.maintainers)) self.assertEqual([], template.urls)
def test_create_project_template(self): template = ProjectTemplate._create_project_template( project_name='bar2', alpine_deps=['dep1', 'dep2']) self.assertEqual('dep1', template.builddeps[0].name) self.assertEqual('dep2', template.builddeps[1].name)