Exemplo n.º 1
0
    def test_artifacts_yaml_are_valid(self):
        """
        Verify that all artifacts resolve to correct URLs.
        """
        repository = load_artifacts()
        for platform in ('osx', 'linux'):
            for name, artifact in repository.artifacts.items():
                url = get_artifact_url(repository.root_url, artifact, platform=platform)
                from urllib.request import urlopen, Request, HTTPError

                try:
                    with urlopen(Request(url, method='HEAD')) as response:
                        if response.status != 200:
                            print(f'{url}: {response.status}')
                except HTTPError as err:
                    print(f'{url}: {err.code}')
Exemplo n.º 2
0
 def test_artifact_url_packaging_native(self):
     expected = 'http://nowhere/repo/com/something/somewhere/0.0.0/somewhere-0.0.0-osx.tar.gz'
     actual = get_artifact_url('http://nowhere/repo/', DUMMY_NATIVE_TAR_GZ_ARTIFACT, platform='osx')
     self.assertEqual(expected, actual)
Exemplo n.º 3
0
 def test_artifact_url_packaging(self):
     expected = 'http://nowhere/repo/com/something/somewhere/0.0.0/somewhere-0.0.0.tar.gz'
     actual = get_artifact_url('http://nowhere/repo/', DUMMY_TAR_GZ_ARTIFACT)
     self.assertEqual(expected, actual)
Exemplo n.º 4
0
 def test_artifact_url_root_slash(self):
     expected = 'http://nowhere/repo/com/something/somewhere/0.0.0/somewhere-0.0.0.jar'
     actual = get_artifact_url('http://nowhere/repo/', DUMMY_ARTIFACT)
     self.assertEqual(expected, actual)
Exemplo n.º 5
0
def test_artifact_url_native():
    expected = 'http://nowhere/repo/com/something/somewhere/0.0.0/somewhere-0.0.0-osx.jar'
    actual = get_artifact_url('http://nowhere/repo/',
                              DUMMY_NATIVE_ARTIFACT,
                              platform='osx')
    assert expected == actual
Exemplo n.º 6
0
def test_artifact_url_no_root_slash():
    expected = 'http://nowhere/repo/com/something/somewhere/0.0.0/somewhere-0.0.0.jar'
    actual = get_artifact_url('http://nowhere/repo', DUMMY_ARTIFACT)
    assert expected == actual