Пример #1
0
def test_url_parse_name_and_version(name, version, url):
    # Make sure correct name and version are extracted.
    parsed_name, parsed_version = parse_name_and_version(url)
    assert parsed_name == name
    assert parsed_version == Version(version)

    # Make sure Spack formulates the right URL when we try to
    # build one with a specific version.
    assert url == substitute_version(url, version)
Пример #2
0
    def check(self, name, v, string, **kwargs):
        # Make sure correct name and version are extracted.
        parsed_name, parsed_v = url.parse_name_and_version(string)
        self.assertEqual(parsed_name, name)
        self.assertEqual(parsed_v, url.Version(v))

        # Some URLs (like boost) are special and need to override the
        # built-in functionality.
        if kwargs.get('no_check_url', False):
            return

        # Make sure Spack formulates the right URL when we try to
        # build one with a specific version.
        self.assertEqual(string, url.substitute_version(string, v))
Пример #3
0
    def check(self, name, v, string, **kwargs):
        # Make sure correct name and version are extracted.
        parsed_name, parsed_v = url.parse_name_and_version(string)
        self.assertEqual(parsed_name, name)
        self.assertEqual(parsed_v, url.Version(v))

        # Some URLs (like boost) are special and need to override the
        # built-in functionality.
        if kwargs.get('no_check_url', False):
            return

        # Make sure Spack formulates the right URL when we try to
        # build one with a specific version.
        self.assertEqual(string, url.substitute_version(string, v))
Пример #4
0
def test_no_version(not_detectable_url):
    with pytest.raises(UndetectableVersionError):
        parse_name_and_version(not_detectable_url)
Пример #5
0
 def assert_detected(self, name, v, string):
     parsed_name, parsed_v = url.parse_name_and_version(string)
     self.assertEqual(parsed_name, name)
     self.assertEqual(parsed_v, url.Version(v))