示例#1
0
    def test_parse_creates_package_from_nuspec(self):
        test_file = self.get_test_loc('nuget/Microsoft.Net.Http.nuspec')
        package = nuget.parse(test_file)
        expected = OrderedDict([
            ('type', u'Nuget'), ('name', u'Microsoft.Net.Http'),
            ('version', u'2.2.29'), ('primary_language', None),
            ('packaging', u'archive'),
            ('summary', u'Microsoft HTTP Client Libraries'),
            ('description',
             u'This package includes HttpClient for sending requests over HTTP, as well as HttpRequestMessage and HttpResponseMessage for '
             u'processing HTTP messages.\n\nThis package is not supported in Visual Studio 2010, and is only required for projects targeting'
             u' .NET Framework 4.5, Windows 8, or Windows Phone 8.1 when consuming a library that uses this package.\n\nSupported Platforms:'
             u'\n- .NET Framework 4\n- Windows 8\n- Windows Phone 8.1\n- Windows Phone Silverlight 7.5\n- Silverlight 4\n- Portable Class Libraries'
             ), ('payload_type', None), ('size', None), ('release_date', None),
            ('authors', [
                OrderedDict([('type', None), ('name', u'Microsoft'),
                             ('email', None), ('url', None)])
            ]), ('maintainers', []), ('contributors', []),
            ('owners', [
                OrderedDict([('type', None), ('name', u'Microsoft'),
                             ('email', None), ('url', None)])
            ]), ('packagers', []), ('distributors', []), ('vendors', []),
            ('keywords', []), ('keywords_doc_url', None),
            ('metafile_locations', []), ('metafile_urls', []),
            ('homepage_url', u'http://go.microsoft.com/fwlink/?LinkID=280055'),
            ('notes', None), ('download_urls', []), ('download_sha1', None),
            ('download_sha256', None), ('download_md5', None),
            ('bug_tracking_url', None), ('support_contacts', []),
            ('code_view_url', None), ('vcs_tool', None),
            ('vcs_repository', None), ('vcs_revision', None),
            ('copyright_top_level', None),
            ('copyrights', [u'Copyright \xa9 Microsoft Corporation']),
            ('asserted_licenses', [
                OrderedDict([
                    ('license', None),
                    ('url', u'http://go.microsoft.com/fwlink/?LinkId=329770'),
                    ('text', None), ('notice', None)
                ])
            ]), ('legal_file_locations', []), ('license_expression', None),
            ('license_texts', []), ('notice_texts', []), ('dependencies', {}),
            ('related_packages', [])
        ])

        assert expected == package.to_dict()
示例#2
0
    def test_parse_creates_package_from_nuspec(self):
        test_file = self.get_test_loc('nuget/Microsoft.Net.Http.nuspec')
        package = nuget.parse(test_file)
        expected = OrderedDict([
            ('type', u'Nuget'),
            ('name', u'Microsoft.Net.Http'),
            ('version', u'2.2.29'),
            ('primary_language', None),
            ('packaging', u'archive'),
            ('summary', u'Microsoft HTTP Client Libraries'),
            ('description', u'This package includes HttpClient for sending requests over HTTP, as well as HttpRequestMessage and HttpResponseMessage for '
                            u'processing HTTP messages.\n\nThis package is not supported in Visual Studio 2010, and is only required for projects targeting'
                            u' .NET Framework 4.5, Windows 8, or Windows Phone 8.1 when consuming a library that uses this package.\n\nSupported Platforms:'
                            u'\n- .NET Framework 4\n- Windows 8\n- Windows Phone 8.1\n- Windows Phone Silverlight 7.5\n- Silverlight 4\n- Portable Class Libraries'),
            ('payload_type', None),
            ('size', None),
            ('release_date', None),
            ('authors', [OrderedDict([('type', None), ('name', u'Microsoft'), ('email', None), ('url', None)])]),
            ('maintainers', []), ('contributors', []),
            ('owners', [OrderedDict([('type', None), ('name', u'Microsoft'), ('email', None), ('url', None)])]),
            ('packagers', []), ('distributors', []), ('vendors', []),
            ('keywords', []), ('keywords_doc_url', None),
            ('metafile_locations', []),
            ('metafile_urls', []),
            ('homepage_url', u'http://go.microsoft.com/fwlink/?LinkID=280055'),
            ('notes', None), ('download_urls', []),
            ('download_sha1', None), ('download_sha256', None), ('download_md5', None),
            ('bug_tracking_url', None), ('support_contacts', []), ('code_view_url', None),
            ('vcs_tool', None), ('vcs_repository', None), ('vcs_revision', None),
            ('copyright_top_level', None), ('copyrights', [u'Copyright \xa9 Microsoft Corporation']),
            ('asserted_licenses', [OrderedDict([('license', None), ('url', u'http://go.microsoft.com/fwlink/?LinkId=329770'), ('text', None), ('notice', None)])]),
            ('legal_file_locations', []), ('license_expression', None), ('license_texts', []), ('notice_texts', []),
            ('dependencies', {}), ('related_packages', [])])


        assert expected == package.to_dict()
示例#3
0
 def test_parse_as_package(self):
     test_file = self.get_test_loc('nuget/Castle.Core.nuspec')
     package = nuget.parse(test_file)
     expected_loc = self.get_test_loc(
         'nuget/Castle.Core.nuspec.json.expected')
     self.check_package(package, expected_loc, regen=False)
示例#4
0
 def test_parse_creates_package_from_nuspec(self):
     test_file = self.get_test_loc('nuget/Microsoft.Net.Http.nuspec')
     package = nuget.parse(test_file)
     expected_loc = self.get_test_loc(
         'nuget/Microsoft.Net.Http.nuspec.json.expected')
     self.check_package(package, expected_loc, regen=False)
示例#5
0
 def test_parse_creates_package_from_nuspec_jquery_ui(self):
     test_file = self.get_test_loc('nuget/jQuery.UI.Combined.nuspec')
     package = nuget.parse(test_file)
     expected_loc = self.get_test_loc(
         'nuget/jQuery.UI.Combined.nuspec.json.expected')
     self.check_package(package, expected_loc, regen=False)
示例#6
0
 def test_parse_creates_package_from_nuspec_entity_framework(self):
     test_file = self.get_test_loc('nuget/EntityFramework.nuspec')
     package = nuget.parse(test_file)
     expected_loc = self.get_test_loc(
         'nuget/EntityFramework.nuspec.json.expected')
     self.check_package(package, expected_loc, regen=False)
示例#7
0
 def test_parse_creates_package_from_nuspec_bootstrap(self):
     test_file = self.get_test_loc('nuget/bootstrap.nuspec')
     package = nuget.parse(test_file)
     expected_loc = self.get_test_loc(
         'nuget/bootstrap.nuspec.json.expected')
     self.check_package(package, expected_loc, regen=False)