|
@@ -1497,13 +1497,14 @@ class BuildPathTest(unittest.TestCase):
|
|
|
service_dict = load_from_filename('tests/fixtures/build-path/docker-compose.yml')
|
|
|
self.assertEquals(service_dict, [{'name': 'foo', 'build': self.abs_context_path}])
|
|
|
|
|
|
- def test_valid_url_path(self):
|
|
|
+ def test_valid_url_in_build_path(self):
|
|
|
valid_urls = [
|
|
|
'git://github.com/docker/docker',
|
|
|
'[email protected]:docker/docker.git',
|
|
|
'[email protected]:atlassianlabs/atlassian-docker.git',
|
|
|
'https://github.com/docker/docker.git',
|
|
|
'http://github.com/docker/docker.git',
|
|
|
+ 'github.com/docker/docker.git',
|
|
|
]
|
|
|
for valid_url in valid_urls:
|
|
|
service_dict = config.load(build_config_details({
|
|
@@ -1511,6 +1512,19 @@ class BuildPathTest(unittest.TestCase):
|
|
|
}, '.', None))
|
|
|
assert service_dict[0]['build'] == valid_url
|
|
|
|
|
|
+ def test_invalid_url_in_build_path(self):
|
|
|
+ invalid_urls = [
|
|
|
+ 'example.com/bogus',
|
|
|
+ 'ftp://example.com/',
|
|
|
+ '/path/does/not/exist',
|
|
|
+ ]
|
|
|
+ for invalid_url in invalid_urls:
|
|
|
+ with pytest.raises(ConfigurationError) as exc:
|
|
|
+ config.load(build_config_details({
|
|
|
+ 'invalidurl': {'build': invalid_url},
|
|
|
+ }, '.', None))
|
|
|
+ assert 'build path' in exc.exconly()
|
|
|
+
|
|
|
|
|
|
class GetDefaultConfigFilesTestCase(unittest.TestCase):
|
|
|
|