diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-31 10:30:53 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-31 10:30:53 +0300 |
commit | f75fee2cd48b1948b23d7959e965192c19dcc685 (patch) | |
tree | 24367b5b84a03ded203661263bdc14eb6a467282 /test | |
parent | sort requirements.txt (diff) | |
download | cgitize-f75fee2cd48b1948b23d7959e965192c19dcc685.tar.gz cgitize-f75fee2cd48b1948b23d7959e965192c19dcc685.zip |
test: add homepage URL tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test_bitbucket.py | 18 | ||||
-rw-r--r-- | test/test_github.py | 5 |
2 files changed, 13 insertions, 10 deletions
diff --git a/test/test_bitbucket.py b/test/test_bitbucket.py index 776c48c..7a070ce 100644 --- a/test/test_bitbucket.py +++ b/test/test_bitbucket.py @@ -22,13 +22,15 @@ class BitbucketTests(unittest.TestCase): self.assertEqual(r['name'], 'cgitize-test-repository') self.assertEqual(r['description'], 'Test cgitize repository') - https_links = [link for link in r['links']['clone'] if link['name'] == 'https'] - self.assertEqual(len(https_links), 1) - self.assertEqual(https_links[0]['href'], 'https://bitbucket.org/egor-tensin/cgitize-test-repository.git') - - ssh_links = [link for link in r['links']['clone'] if link['name'] == 'ssh'] - self.assertEqual(len(ssh_links), 1) - self.assertEqual(ssh_links[0]['href'], 'git@bitbucket.org:egor-tensin/cgitize-test-repository.git') - self.assertEqual(r['owner']['display_name'], 'Egor Tensin') self.assertEqual(r['owner']['nickname'], 'egor-tensin') + + self.assertEqual(r['links']['html']['href'], 'https://bitbucket.org/egor-tensin/cgitize-test-repository') + + clone_urls = [link for link in r['links']['clone'] if link['name'] == 'https'] + self.assertEqual(len(clone_urls), 1) + self.assertEqual(clone_urls[0]['href'], 'https://bitbucket.org/egor-tensin/cgitize-test-repository.git') + + ssh_urls = [link for link in r['links']['clone'] if link['name'] == 'ssh'] + self.assertEqual(len(ssh_urls), 1) + self.assertEqual(ssh_urls[0]['href'], 'git@bitbucket.org:egor-tensin/cgitize-test-repository.git') diff --git a/test/test_github.py b/test/test_github.py index ab96ecc..be1daf6 100644 --- a/test/test_github.py +++ b/test/test_github.py @@ -20,7 +20,8 @@ class GitHubTests(unittest.TestCase): r = self.github.get_repo('egor-tensin/cgitize-test-repository') self.assertEqual(r.name, 'cgitize-test-repository') self.assertEqual(r.description, 'Test cgitize repository') - self.assertEqual(r.clone_url, 'https://github.com/egor-tensin/cgitize-test-repository.git') - self.assertEqual(r.ssh_url, 'git@github.com:egor-tensin/cgitize-test-repository.git') self.assertEqual(r.owner.name, 'Egor Tensin') self.assertEqual(r.owner.login, 'egor-tensin') + self.assertEqual(r.html_url, 'https://github.com/egor-tensin/cgitize-test-repository') + self.assertEqual(r.clone_url, 'https://github.com/egor-tensin/cgitize-test-repository.git') + self.assertEqual(r.ssh_url, 'git@github.com:egor-tensin/cgitize-test-repository.git') |