@@ -545,7 +545,10 @@ def test_projects_new_with_project_name_and_org(
545
545
m = requests_mock .Mocker ()
546
546
stack .enter_context (m )
547
547
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
548
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
548
+ m .get (
549
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
550
+ json = [{'organization_name' : 'fake_org' }],
551
+ )
549
552
create_project_response = {
550
553
'json' : {
551
554
'project_name' : 'myproject' ,
@@ -588,7 +591,10 @@ def test_projects_new_with_project_name_without_org(
588
591
m = requests_mock .Mocker ()
589
592
stack .enter_context (m )
590
593
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
591
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
594
+ m .get (
595
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
596
+ json = [{'organization_name' : 'fake_org' }],
597
+ )
592
598
create_project_response = {
593
599
'json' : {
594
600
'project_name' : 'myproject' ,
@@ -633,7 +639,10 @@ def test_projects_new_with_project_name_and_wrong_org(
633
639
m = requests_mock .Mocker ()
634
640
stack .enter_context (m )
635
641
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
636
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
642
+ m .get (
643
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
644
+ json = [{'organization_name' : 'fake_org' }],
645
+ )
637
646
create_project_response = {
638
647
'json' : {
639
648
'project_name' : 'myproject' ,
@@ -676,7 +685,10 @@ def test_projects_new_with_project_name_and_default_org(
676
685
m = requests_mock .Mocker ()
677
686
stack .enter_context (m )
678
687
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
679
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
688
+ m .get (
689
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
690
+ json = [{'organization_name' : 'fake_org' }],
691
+ )
680
692
create_project_response = {
681
693
'json' : {
682
694
'project_name' : 'myproject' ,
@@ -718,7 +730,7 @@ def test_projects_new_with_project_name_multiple_organizations(
718
730
stack .enter_context (m )
719
731
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
720
732
m .get (
721
- 'https://logfire-us.pydantic.dev/v1/organizations/' ,
733
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/ ' ,
722
734
json = [{'organization_name' : 'fake_org' }, {'organization_name' : 'fake_default_org' }],
723
735
)
724
736
m .get (
@@ -774,7 +786,7 @@ def test_projects_new_with_project_name_and_default_org_multiple_organizations(
774
786
stack .enter_context (m )
775
787
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
776
788
m .get (
777
- 'https://logfire-us.pydantic.dev/v1/organizations/' ,
789
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/ ' ,
778
790
json = [{'organization_name' : 'fake_org' }, {'organization_name' : 'fake_default_org' }],
779
791
)
780
792
m .get (
@@ -822,7 +834,10 @@ def test_projects_new_without_project_name(
822
834
m = requests_mock .Mocker ()
823
835
stack .enter_context (m )
824
836
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
825
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
837
+ m .get (
838
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
839
+ json = [{'organization_name' : 'fake_org' }],
840
+ )
826
841
create_project_response = {
827
842
'json' : {
828
843
'project_name' : 'myproject' ,
@@ -867,7 +882,10 @@ def test_projects_new_invalid_project_name(
867
882
m = requests_mock .Mocker ()
868
883
stack .enter_context (m )
869
884
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
870
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
885
+ m .get (
886
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
887
+ json = [{'organization_name' : 'fake_org' }],
888
+ )
871
889
create_project_response = {
872
890
'json' : {
873
891
'project_name' : 'myproject' ,
@@ -917,7 +935,10 @@ def test_projects_new_error(tmp_dir_cwd: Path, default_credentials: Path) -> Non
917
935
m = requests_mock .Mocker ()
918
936
stack .enter_context (m )
919
937
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
920
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
938
+ m .get (
939
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
940
+ json = [{'organization_name' : 'fake_org' }],
941
+ )
921
942
create_project_response = {
922
943
'json' : {
923
944
'project_name' : 'myproject' ,
@@ -952,7 +973,10 @@ def test_projects_without_project_name_without_org(
952
973
m = requests_mock .Mocker ()
953
974
stack .enter_context (m )
954
975
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
955
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
976
+ m .get (
977
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
978
+ json = [{'organization_name' : 'fake_org' }],
979
+ )
956
980
create_project_response = {
957
981
'json' : {
958
982
'project_name' : 'myproject' ,
@@ -996,7 +1020,7 @@ def test_projects_new_get_organizations_error(tmp_dir_cwd: Path, default_credent
996
1020
997
1021
m = requests_mock .Mocker ()
998
1022
stack .enter_context (m )
999
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , text = 'Error' , status_code = 500 )
1023
+ m .get ('https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/ ' , text = 'Error' , status_code = 500 )
1000
1024
1001
1025
with pytest .raises (LogfireConfigError , match = 'Error retrieving list of organizations' ):
1002
1026
main (['projects' , 'new' ])
@@ -1017,7 +1041,7 @@ def test_projects_new_get_user_info_error(tmp_dir_cwd: Path, default_credentials
1017
1041
stack .enter_context (m )
1018
1042
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
1019
1043
m .get (
1020
- 'https://logfire-us.pydantic.dev/v1/organizations/' ,
1044
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/ ' ,
1021
1045
json = [{'organization_name' : 'fake_org' }, {'organization_name' : 'fake_default_org' }],
1022
1046
)
1023
1047
m .get ('https://logfire-us.pydantic.dev/v1/account/me' , text = 'Error' , status_code = 500 )
@@ -1041,7 +1065,10 @@ def test_projects_new_create_project_error(tmp_dir_cwd: Path, default_credential
1041
1065
m = requests_mock .Mocker ()
1042
1066
stack .enter_context (m )
1043
1067
m .get ('https://logfire-us.pydantic.dev/v1/writable-projects/' , json = [])
1044
- m .get ('https://logfire-us.pydantic.dev/v1/organizations/' , json = [{'organization_name' : 'fake_org' }])
1068
+ m .get (
1069
+ 'https://logfire-us.pydantic.dev/v1/organizations/available-for-projects/' ,
1070
+ json = [{'organization_name' : 'fake_org' }],
1071
+ )
1045
1072
m .post ('https://logfire-us.pydantic.dev/v1/organizations/fake_org/projects' , text = 'Error' , status_code = 500 )
1046
1073
1047
1074
with pytest .raises (LogfireConfigError , match = 'Error creating new project' ):
0 commit comments