From 55de1c30387cd882991318c13649f512023d89f9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 26 2018 10:37:19 +0000 Subject: Fixes in the tests for the ssh URL pattern Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_flask_util.py b/tests/test_pagure_flask_util.py index 5eec180..da18950 100644 --- a/tests/test_pagure_flask_util.py +++ b/tests/test_pagure_flask_util.py @@ -34,14 +34,15 @@ class PagureUtilSSHPatterntests(tests.Modeltests): patterns = [ 'ssh://user@host.com/repo.git', 'git+ssh://user@host.com/repo.git', - 'ssh://host.com/repo.git' - 'git+ssh://host.com/repo.git', - 'ssh://127.0.0.1/repo.git', - 'git+ssh://127.0.0.1/repo.git', + 'ssh://user@host.lcl:/path/to/repo.git', + 'git@github.com:user/project.git', + 'ssh://user@host.org/target', + 'git+ssh://user@host.org/target', + 'git+ssh://user@host.lcl:/path/to/repo.git', ] for pattern in patterns: print(pattern) - self.assertTrue(ssh_urlpattern.match(pattern)) + self.assertIsNotNone(ssh_urlpattern.match(pattern)) def test_ssh_pattern_invalid(self): @@ -52,13 +53,17 @@ class PagureUtilSSHPatterntests(tests.Modeltests): 'https://user@host.com/repo.git', 'git+https://user@host.com/repo.git', 'ssh://localhost/repo.git', + 'ssh://host.com/repo.git', 'git+ssh://localhost/repo.git', 'ssh://0.0.0.0/repo.git', 'git+ssh://0.0.0.0/repo.git', + 'git+ssh://host.com/repo.git', + 'ssh://127.0.0.1/repo.git', + 'git+ssh://127.0.0.1/repo.git', ] for pattern in patterns: print(pattern) - self.assertFalse(ssh_urlpattern.match(pattern)) + self.assertIsNone(ssh_urlpattern.match(pattern)) if __name__ == '__main__':