mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 22:31:25 -07:00
Friendly Role Names and roles from URLs
* Roles can now be given a friendly name as third field in role spec csv * Roles can be installed from URL (not just from archived SCMs) * Integration tests to demonstrate this * Unit tests to ensure that role spec parsing works as expected
This commit is contained in:
parent
4803e923ff
commit
46b59b02ed
6 changed files with 81 additions and 67 deletions
|
@ -784,3 +784,12 @@ class TestUtils(unittest.TestCase):
|
|||
("ssh://git@git.example.com:repos/role-name,v0.1", "role-name")]
|
||||
for (url, result) in tests:
|
||||
self.assertEqual(ansible.utils.repo_url_to_role_name(url), result)
|
||||
|
||||
def test_role_spec_parse(self):
|
||||
tests = [("git+http://git.example.com/repos/repo.git,v1.0", ('git', 'http://git.example.com/repos/repo.git', 'v1.0', 'repo')),
|
||||
("http://repo.example.com/download/tarfile.tar.gz", (None, 'http://repo.example.com/download/tarfile.tar.gz', '', 'tarfile')),
|
||||
("http://repo.example.com/download/tarfile.tar.gz,,nicename", (None, 'http://repo.example.com/download/tarfile.tar.gz', '', 'nicename')),
|
||||
("git+http://git.example.com/repos/repo.git,v1.0,awesome", ('git', 'http://git.example.com/repos/repo.git', 'v1.0', 'awesome'))]
|
||||
for (spec, result) in tests:
|
||||
self.assertEqual(ansible.utils.role_spec_parse(spec), result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue