def test_custom(self): hosting_services = tuple(list(HOSTING_SERVICES) + ['kiln']) repo_url = "http://example.kiln.com/" self.assertEqual( identify_hosting_service(repo_url, hosting_services=hosting_services), "kiln")
def test_gitorious(self): repo_url = "git://gitorious.org/gitorious/mainline.git" self.assertEqual(identify_hosting_service(repo_url), "gitorious") repo_url = "http://git.gitorious.org/gitorious/mainline.git" self.assertEqual(identify_hosting_service(repo_url), "gitorious")
def test_bitbucket(self): repo_url = "https://bitbucket/pydanny/static/" self.assertEqual(identify_hosting_service(repo_url), "bitbucket")
def test_github(self): repo_url = "[email protected]:pydanny/watdarepo.git" self.assertEqual(identify_hosting_service(repo_url), "github") repo_url = "https://github.com/pydanny/watdarepo.git" self.assertEqual(identify_hosting_service(repo_url), "github")
def test_gitlab(self): repo_url = "http://demo.gitlab.com/" self.assertEqual(identify_hosting_service(repo_url), "gitlab")
def test_failure(self): with self.assertRaises(UnknownHostingService): identify_hosting_service("American Hotdogs!")
def test_custom(self): hosting_services = tuple(list(HOSTING_SERVICES) + ['kiln']) repo_url = "http://example.kiln.com/" self.assertEqual(identify_hosting_service(repo_url, hosting_services=hosting_services), "kiln")