feat: add WORKSPACE visibility for projects (#421)
Publish Python Package / continuous-integration (3.10) (push) Has been cancelled
Publish Python Package / continuous-integration (3.11) (push) Has been cancelled
Publish Python Package / continuous-integration (3.12) (push) Has been cancelled
Publish Python Package / continuous-integration (3.13) (push) Has been cancelled
Publish Python Package / Build and Publish Python Package (push) Has been cancelled

* feat: add WORKSPACE visibility for projects

* tests: projects are now private by default, follow that in tests
This commit is contained in:
Gergő Jedlicska
2025-05-15 14:35:54 +02:00
committed by GitHub
parent 6d6e1e7650
commit 4ce61f4e89
3 changed files with 15 additions and 6 deletions
+6
View File
@@ -2,9 +2,15 @@ from enum import Enum
class ProjectVisibility(str, Enum):
"""Supported project visibility types"""
PRIVATE = "PRIVATE"
PUBLIC = "PUBLIC"
UNLISTED = "UNLISTED"
WORKSPACE = "WORKSPACE"
foo = ProjectVisibility.PRIVATE
class UserProjectsUpdatedMessageType(str, Enum):
@@ -3,6 +3,7 @@ from typing import Optional
import pytest
from specklepy.api.client import SpeckleClient
from specklepy.core.api.enums import ProjectVisibility
from specklepy.core.api.inputs.project_inputs import (
ProjectCreateInput,
ProjectInviteCreateInput,
@@ -22,7 +23,9 @@ class TestProjectInviteResource:
@pytest.fixture
def project(self, client: SpeckleClient):
return client.project.create(
ProjectCreateInput(name="test", description=None, visibility=None)
ProjectCreateInput(
name="test", description=None, visibility=ProjectVisibility.PUBLIC
)
)
@pytest.fixture
@@ -51,8 +51,8 @@ class TestProjectResource:
assert result.name == name
assert result.description == (description or "")
# we've disabled creation of public projects for now, they fall back to unlisted
if visibility == ProjectVisibility.PUBLIC:
assert result.visibility == ProjectVisibility.UNLISTED
if visibility == ProjectVisibility.UNLISTED:
assert result.visibility == ProjectVisibility.PUBLIC
else:
assert result.visibility == visibility
@@ -78,7 +78,7 @@ class TestProjectResource:
def test_project_update(self, client: SpeckleClient, test_project: Project):
new_name = "MY new name"
new_description = "MY new desc"
new_visibility = ProjectVisibility.PUBLIC
new_visibility = ProjectVisibility.UNLISTED
update_data = ProjectUpdateInput(
id=test_project.id,
@@ -94,8 +94,8 @@ class TestProjectResource:
assert updated_project.name == new_name
assert updated_project.description == new_description
# we've disabled creation of public projects for now, they fall back to unlisted
if new_visibility == ProjectVisibility.PUBLIC:
assert updated_project.visibility == ProjectVisibility.UNLISTED
if new_visibility == ProjectVisibility.UNLISTED:
assert updated_project.visibility == ProjectVisibility.PUBLIC
else:
assert updated_project.visibility == new_visibility