3333)
3434from src .pytfe .models .project import Project
3535from src .pytfe .models .workspace import (
36- VCSRepo ,
36+ VCSRepoOptions ,
3737 Workspace ,
3838 WorkspaceAddRemoteStateConsumersOptions ,
3939 WorkspaceAddTagBindingsOptions ,
@@ -304,7 +304,7 @@ def test_create_workspace_with_vcs(
304304 sample_workspace_response
305305 )
306306
307- vcs_repo = VCSRepo (
307+ vcs_repo = VCSRepoOptions (
308308 identifier = "myorg/myrepo" ,
309309 branch = "main" ,
310310 oauth_token_id = "ot-123456" ,
@@ -316,7 +316,6 @@ def test_create_workspace_with_vcs(
316316 name = "vcs-workspace" ,
317317 vcs_repo = vcs_repo ,
318318 working_directory = "terraform/" ,
319- # Remove trigger_prefixes to avoid conflict with tags_regex
320319 )
321320
322321 workspace = workspaces_service .create ("test-org" , options = options )
@@ -611,11 +610,11 @@ def test_unassign_ssh_key(
611610 def test_ws_from_conversion (self , sample_workspace_response ):
612611 """Test _ws_from helper function conversion."""
613612 workspace_data = sample_workspace_response ["data" ]
614- workspace = _ws_from (workspace_data , "test-org" )
613+ workspace = _ws_from (workspace_data )
615614
616615 assert workspace .id == "ws-abc123def456"
617616 assert workspace .name == "test-workspace"
618- assert workspace .organization == "test-org"
617+ assert workspace .organization is None
619618 assert workspace .auto_apply
620619 assert workspace .execution_mode == ExecutionMode .REMOTE
621620 assert workspace .resource_count == 25
@@ -633,11 +632,11 @@ def test_ws_from_minimal_data(self):
633632 """Test _ws_from with minimal data."""
634633 minimal_data = {"id" : "ws-minimal" , "attributes" : {"name" : "minimal-workspace" }}
635634
636- workspace = _ws_from (minimal_data , "test-org" )
635+ workspace = _ws_from (minimal_data )
637636
638637 assert workspace .id == "ws-minimal"
639638 assert workspace .name == "minimal-workspace"
640- assert workspace .organization == "test-org"
639+ assert workspace .organization is None
641640 assert not workspace .auto_apply # Default value
642641 assert not workspace .locked # Default value
643642
@@ -676,11 +675,11 @@ def test_none_values_handling(self):
676675 },
677676 }
678677
679- workspace = _ws_from (data_with_nones , "test-org" )
678+ workspace = _ws_from (data_with_nones )
680679
681- assert workspace .description == "" # Should convert None to empty string
682- assert workspace .terraform_version == ""
683- assert workspace .working_directory == ""
680+ assert workspace .description is None # None values are preserved
681+ assert workspace .terraform_version is None
682+ assert workspace .working_directory is None
684683 assert workspace .vcs_repo is None
685684
686685 # ==========================================
@@ -758,14 +757,13 @@ def test_list_remote_state_consumers_with_pagination(
758757 # Verify pagination parameters were passed
759758 call_args = mock_transport .request .call_args
760759 params = call_args [1 ]["params" ]
761- assert params ["page[number]" ] == 1
762760 assert params ["page[size]" ] == 5
763761
764762 def test_add_remote_state_consumers_basic (self , workspaces_service , mock_transport ):
765763 """Test adding remote state consumers."""
766764 consumer_workspaces = [
767- Workspace (id = "ws-consumer-1" , name = "consumer-1" , organization = "test-org" ),
768- Workspace (id = "ws-consumer-2" , name = "consumer-2" , organization = "test-org" ),
765+ Workspace (id = "ws-consumer-1" , name = "consumer-1" , organization = None ),
766+ Workspace (id = "ws-consumer-2" , name = "consumer-2" , organization = None ),
769767 ]
770768
771769 options = WorkspaceAddRemoteStateConsumersOptions (
@@ -806,7 +804,7 @@ def test_add_remote_state_consumers_validation_errors(self, workspaces_service):
806804
807805 # Test invalid workspace ID format (with slash)
808806 options = WorkspaceAddRemoteStateConsumersOptions (
809- workspaces = [Workspace (id = "ws-valid" , name = "valid" , organization = "test-org" )]
807+ workspaces = [Workspace (id = "ws-valid" , name = "valid" , organization = None )]
810808 )
811809
812810 with pytest .raises (InvalidWorkspaceIDError ):
@@ -817,7 +815,7 @@ def test_remove_remote_state_consumers_basic(
817815 ):
818816 """Test removing remote state consumers."""
819817 consumer_workspaces = [
820- Workspace (id = "ws-consumer-1" , name = "consumer-1" , organization = "test-org" ),
818+ Workspace (id = "ws-consumer-1" , name = "consumer-1" , organization = None ),
821819 ]
822820
823821 options = WorkspaceRemoveRemoteStateConsumersOptions (
@@ -844,8 +842,8 @@ def test_update_remote_state_consumers_basic(
844842 ):
845843 """Test updating (replacing) remote state consumers."""
846844 consumer_workspaces = [
847- Workspace (id = "ws-consumer-3" , name = "consumer-3" , organization = "test-org" ),
848- Workspace (id = "ws-consumer-4" , name = "consumer-4" , organization = "test-org" ),
845+ Workspace (id = "ws-consumer-3" , name = "consumer-3" , organization = None ),
846+ Workspace (id = "ws-consumer-4" , name = "consumer-4" , organization = None ),
849847 ]
850848
851849 options = WorkspaceUpdateRemoteStateConsumersOptions (
@@ -929,7 +927,6 @@ def test_list_tags_with_query_and_pagination(
929927 call_args = mock_transport .request .call_args
930928 params = call_args [1 ]["params" ]
931929 assert params ["name" ] == "env"
932- assert params ["page[number]" ] == 1
933930 assert params ["page[size]" ] == 5
934931
935932 def test_add_tags_basic (self , workspaces_service , mock_transport ):
0 commit comments