Esempio n. 1
0
    def test_write_namespaces(self):
        """Tests skeleton.examples.basicpackage.BasicPackage with namespaces
        """
        skel = BasicPackage(
            project_name='foo.bar.baz',
            package_name='foo.bar.baz',
            author='Damien Lebrun',
            author_email='*****@*****.**'
            )

        with TempDir() as tmp:
            skel.write(tmp.path)

            self.assertEqual(set(skel['ns_packages']), set(['foo', 'foo.bar']))
            self.assertEqual(
                set(skel['packages']),
                set(['foo', 'foo.bar', 'foo.bar.baz']))

            self.assertTrue(tmp.exists('distribute_setup.py'))
            self.assertTrue(tmp.exists('MANIFEST.in'))
            self.assertTrue(tmp.exists('README.rst'))
            self.assertTrue(tmp.exists('LICENSE'))
            self.assertTrue(tmp.exists('setup.py'))
            self.assertTrue(tmp.exists('foo/__init__.py'))
            self.assertTrue(tmp.exists('foo/bar/__init__.py'))
            self.assertTrue(tmp.exists('foo/bar/baz/__init__.py'))
Esempio n. 2
0
    def test_write_with_bsd(self):
        """Tests skeleton.examples.basicpackage.BasicPackage add BSD license
        """
        skel = BasicPackage(project_name='foo',
                            package_name='foo',
                            author='Damien Lebrun',
                            author_email='*****@*****.**',
                            license='BSD')

        with TempDir() as tmp:
            skel.write(tmp.path)
            self.assertTrue(tmp.exists('LICENSE'))

            fragment = """
            Redistributions of source code must retain the above copyright notice
            """.strip()
            with open(tmp.join('LICENSE')) as license_file:
                content = license_file.read()
                self.assertTrue(fragment in content)
Esempio n. 3
0
    def test_write_with_bsd(self):
        """Tests skeleton.examples.basicpackage.BasicPackage add BSD license
        """
        skel = BasicPackage(
            project_name='foo',
            package_name='foo',
            author='Damien Lebrun',
            author_email='*****@*****.**',
            license='BSD'
            )

        with TempDir() as tmp:
            skel.write(tmp.path)
            self.assertTrue(tmp.exists('LICENSE'))

            fragment = """
            Redistributions of source code must retain the above copyright notice
            """.strip()
            with open(tmp.join('LICENSE')) as license_file:
                content = license_file.read()
                self.assertTrue(fragment in content)