@@ -448,3 +448,34 @@ def test_absolute_path(self):
448
448
def test_from_file (self ):
449
449
service_dict = config .load ('tests/fixtures/build-path/docker-compose.yml' )
450
450
self .assertEquals (service_dict , [{'name' : 'foo' , 'build' : self .abs_context_path }])
451
+
452
+ def pytest_generate_tests (metafunc ):
453
+ if "valid_url" in metafunc .funcargnames :
454
+ metafunc .parametrize ("valid_url" , [
455
+ 'git://github.com/docker/docker' ,
456
+ 'git@github.com:docker/docker.git' ,
457
+ 'git@bitbucket.org:atlassianlabs/atlassian-docker.git' ,
458
+ 'https://github.com/docker/docker.git' ,
459
+ 'http://github.com/docker/docker.git'
460
+ ])
461
+ elif "invalid_url" in metafunc .funcargnames :
462
+ metafunc .parametrize ("invalid_url" , [
463
+ 'github.com/docker/docker'
464
+ ])
465
+
466
+ def test_valid_url_path (self , valid_url ):
467
+ service_dict = config .make_service_dict (
468
+ {'build' : valid_url },
469
+ working_dir = 'tests/fixtures/build-path'
470
+ )
471
+ self .assertEquals (service_dict ['build' ], valid_url )
472
+
473
+ def test_invalid_url_path (self , invalid_url ):
474
+ options = {'build' : invalid_url }
475
+ self .assertRaises (
476
+ config .ConfigurationError ,
477
+ lambda : config .from_dictionary ({
478
+ 'foo' : options ,
479
+ 'working_dir' : 'tests/fixtures/build-path'
480
+ })
481
+ )
0 commit comments