Example #1
0
    def test_verify_delete_repo(self):
        # For delete we have to create a repo first
        repo_create = post_data(post_repo_url(),
                                auth=get_auth(),
                                payload=None,
                                in_json=False)
        repo_deleted_data = delete_data(delete_repo_url(
            username=get_auth()[0], repo_name=repo_create.json()["name"]),
                                        auth=get_auth(),
                                        in_json=False)
        verify_common.verify_delete_http_status(repo_deleted_data, 204)

        # Get that repo and verify
        data = get_data(get_single_repo_url(
            username=get_auth()[0], repo_name=repo_create.json()["name"]),
                        auth=get_auth(),
                        in_json=False)
        verify_common.verify_get_single_repo(data, 404)
 def test_setup(self):
     print("#1")
     global data
     global name
     name = "TempRepo" + str(random.randint(1, 999))
     payload = {"name": name, "description": "This is your first repository",
                "homepage": "https://github.com", "private": False, "has_issues": True, "has_projects": True,
                "has_wiki": True}
     data = post_data(post_repo_url(), auth=get_auth(), payload=payload, in_json=False)
Example #3
0
    def test_verify_update(self):
        global updated_name
        updated_name = "UPDATED" + str(random.randint(1, 999))
        payload = {
            "name": updated_name,
            "description": "This is your first repository",
            "homepage": "https://github.com",
            "private": False,
            "has_issues": True,
            "has_projects": True,
            "has_wiki": True
        }
        print(name)

        updated_data = patch_data(patch_repo_url(username=get_auth()[0],
                                                 repo_name=name),
                                  auth=get_auth(),
                                  payload=payload,
                                  in_json=True)
        print(updated_data)
        verify_create_repo.verify_repo_data(updated_data, updated_name)
Example #4
0
 def test_contract_get_all(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=True)
     verify_common.verify_contract(data, get_all_repo_contract.get_all_repos)
Example #5
0
 def test_verify_get_all_id_exist(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=True)
     verify_common.verify_id_exist(data, 'id')
Example #6
0
 def test_verify_get_all_headers(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=False)
     verify_common.verify_headers(data, 'application/json; charset=utf-8')
Example #7
0
 def test_verify_get_all_important_keys(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=True)
     verify_common.verify_important_keys(data, 'id,,name,html_url')
Example #8
0
 def test_verify_get_all_http_code(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=False)
     verify_common.verify_http_code(data, '200')
Example #9
0
 def test_verify_get_all_response(self):
     data = get_data(get_repos_url(username=get_auth()[0]), auth=get_auth(), in_json=True)
     verify_common.verify_repo_data(data, 'Demo11236')
Example #10
0
 def test_verify_repo_by_get(self):
     data = get_data(get_single_repo_url(username=get_auth()[0],
                                         repo_name=name),
                     auth=get_auth(),
                     in_json=True)
     verify_common.verify_single_repo_data(data, updated_name)