def test_edit_org_fields_and_commit(instance): org = Organization.request(instance, test_org) org.description = "some thing other man" org.location = "somewehre new" org.visibility = "public" org.website = "http:\\\\testurl.com" org.commit() org2 = Organization.request(instance, test_org) assert org2.name == test_org assert org2.description == "some thing other man" assert org2.location == "somewehre new" # assert org2.visibility == "private" # after commiting, this field just vanishes (Bug?) assert org2.website == "http:\\\\testurl.com"
def test_create_issue(instance): org = Organization.request(instance, test_org) repo = Repository.request(instance, org.username, test_repo) issue = Issue.create_issue(instance, repo, "TestIssue", "Body text with this issue") assert issue.state == Issue.OPENED assert issue.title == "TestIssue" assert issue.body == "Body text with this issue"
def test_create_branch(instance): org = Organization.request(instance, test_org) repo = org.get_repository(test_repo) branches = repo.get_branches() master = [b for b in branches if b.name == "master"] assert len(master) > 0 repo.add_branch(master[0], "test_branch")
def test_list_branches(instance): org = Organization.request(instance, test_org) repo = org.get_repository(test_repo) branches = repo.get_branches() assert len(branches) > 0 master = [b for b in branches if b.name == "master"] assert len(master) > 0
def test_create_repo_orgowned(instance): org = Organization.request(instance, test_org) repo = instance.create_repo(org, test_repo, "descr") assert repo.description == "descr" assert repo.owner == org assert repo.name == test_repo assert not repo.private
def test_non_changable_field(instance): org = Organization.request(instance, test_org) with pytest.raises(AttributeError) as e: org.id = 55
def test_fail_get_non_existent_org(instance): with pytest.raises(NotFoundException) as e: Organization.request(instance, test_org)
def test_delete_org(instance): org = Organization.request(instance, test_org) org.delete() with pytest.raises(NotFoundException) as e: Organization.request(instance, test_org)
def test_delete_team(instance): org = Organization.request(instance, test_org) team = org.get_team(test_team) team.delete() with pytest.raises(NotFoundException) as e: team = org.get_team(test_team)
def test_delete_repo_orgowned(instance): org = Organization.request(instance, test_org) repo = Repository.request(instance, org.username, test_repo) repo.delete() with pytest.raises(NotFoundException) as e: Repository.request(instance, test_user, test_repo)
def test_create_team(instance): org = Organization.request(instance, test_org) team = instance.create_team(org, test_team, "descr") assert team.name == test_team assert team.description == "descr" assert team.organization == org