Пример #1
0
 def __init__(self, name):
     super(MITLicense, self).__init__(
         'LICENSE-MIT', TEMPLATE.format(year=get_current_year(), name=name))
     self.short_name = 'MIT'
     self.long_name = 'MIT License'
     self.pypi_classifier = 'License :: OSI Approved :: MIT License'
     self.url = 'https://choosealicense.com/licenses/mit'
Пример #2
0
 def __init__(self, name):
     super(MPLLicense, self).__init__(
         'LICENSE-MPL', TEMPLATE.format(year=get_current_year(), name=name))
     self.short_name = 'MPL-2.0'
     self.long_name = 'Mozilla Public License 2.0'
     self.pypi_classifier = 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)'
     self.url = 'https://choosealicense.com/licenses/mpl-2.0'
Пример #3
0
 def __init__(self, name):
     super(Apache2License, self).__init__(
         'LICENSE-APACHE',
         TEMPLATE.format(year=get_current_year(), name=name))
     self.short_name = 'Apache-2.0'
     self.long_name = 'Apache License, Version 2.0'
     self.pypi_classifier = 'License :: OSI Approved :: Apache Software License'
     self.url = 'https://choosealicense.com/licenses/apache-2.0'
Пример #4
0
 def __init__(self, name):
     super(CC0License, self).__init__(
         'LICENSE-CC0',
         TEMPLATE.format(year=get_current_year(), name=name)
     )
     self.short_name = 'CC0'
     self.long_name = 'Creative Commons Zero v1.0 Universal'
     self.pypi_classifier = 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'
     self.url = 'https://choosealicense.com/licenses/cc0-1.0'
Пример #5
0
def test_year():
    with temp_chdir() as d:
        settings = copy_default_settings()
        settings['licenses'] = ['mit']
        create_package(d, 'ok', settings)

        contents = read_file(os.path.join(d, 'LICENSE-MIT'))
        parsed = parse(TEMPLATE, contents)

        assert parsed['year'] == get_current_year()
Пример #6
0
def test_get_current_year():
    year = get_current_year()
    assert len(year) >= 4
    assert int(year) >= 2017