@@ -35,6 +35,8 @@ def test_create_session(requests_mock: Mocker) -> None:
3535 "created_at" : "1970-01-01T00:00:00Z" ,
3636 "host" : "1.2.3.4" ,
3737 "memory" : "4Gi" ,
38+ "tenant_id" : "tenant-0" ,
39+ "user_id" : "user-0" ,
3840 },
3941 )
4042
@@ -50,6 +52,8 @@ def test_create_session(requests_mock: Mocker) -> None:
5052 memory = SessionMemory .m_4GB .value ,
5153 expiry_date = None ,
5254 ttl = None ,
55+ tenant_id = "tenant-0" ,
56+ user_id = "user-0" ,
5357 )
5458
5559
@@ -70,6 +74,8 @@ def test_list_session(requests_mock: Mocker) -> None:
7074 "host" : "1.2.3.4" ,
7175 "memory" : "4Gi" ,
7276 "expiry_date" : "1977-01-01T00:00:00Z" ,
77+ "tenant_id" : "tenant-0" ,
78+ "user_id" : "user-0" ,
7379 },
7480 )
7581
@@ -85,6 +91,8 @@ def test_list_session(requests_mock: Mocker) -> None:
8591 memory = SessionMemory .m_4GB .value ,
8692 expiry_date = TimeParser .fromisoformat ("1977-01-01T00:00:00Z" ),
8793 ttl = None ,
94+ tenant_id = "tenant-0" ,
95+ user_id = "user-0" ,
8896 )
8997
9098
@@ -104,6 +112,8 @@ def test_list_sessions(requests_mock: Mocker) -> None:
104112 "host" : "1.2.3.4" ,
105113 "memory" : "4Gi" ,
106114 "expiry_date" : "1977-01-01T00:00:00Z" ,
115+ "tenant_id" : "tenant-1" ,
116+ "user_id" : "user-1" ,
107117 },
108118 {
109119 "id" : "id1" ,
@@ -113,6 +123,8 @@ def test_list_sessions(requests_mock: Mocker) -> None:
113123 "created_at" : "2012-01-01T00:00:00Z" ,
114124 "memory" : "8Gi" ,
115125 "host" : "foo.bar" ,
126+ "tenant_id" : "tenant-2" ,
127+ "user_id" : "user-2" ,
116128 },
117129 ],
118130 )
@@ -129,6 +141,8 @@ def test_list_sessions(requests_mock: Mocker) -> None:
129141 memory = SessionMemory .m_4GB .value ,
130142 expiry_date = TimeParser .fromisoformat ("1977-01-01T00:00:00Z" ),
131143 ttl = None ,
144+ tenant_id = "tenant-1" ,
145+ user_id = "user-1" ,
132146 )
133147
134148 expected2 = SessionDetails (
@@ -141,6 +155,8 @@ def test_list_sessions(requests_mock: Mocker) -> None:
141155 host = "foo.bar" ,
142156 expiry_date = None ,
143157 ttl = None ,
158+ tenant_id = "tenant-2" ,
159+ user_id = "user-2" ,
144160 )
145161
146162 assert result == [expected1 , expected2 ]
@@ -203,6 +219,8 @@ def test_dont_wait_forever_for_session(requests_mock: Mocker, caplog: LogCapture
203219 "host" : "foo.bar" ,
204220 "memory" : "4Gi" ,
205221 "expiry_date" : "1977-01-01T00:00:00Z" ,
222+ "tenant_id" : "tenant-1" ,
223+ "user_id" : "user-1" ,
206224 },
207225 )
208226
@@ -230,6 +248,8 @@ def test_wait_for_session_running(requests_mock: Mocker) -> None:
230248 "host" : "foo.bar" ,
231249 "memory" : "4Gi" ,
232250 "expiry_date" : "1977-01-01T00:00:00Z" ,
251+ "tenant_id" : "tenant-1" ,
252+ "user_id" : "user-1" ,
233253 },
234254 )
235255
@@ -671,6 +691,8 @@ def test_parse_session_info() -> None:
671691 "created_at" : "2021-01-01T00:00:00Z" ,
672692 "host" : "a.b" ,
673693 "ttl" : "1d8h1m2s" ,
694+ "tenant_id" : "tenant-1" ,
695+ "user_id" : "user-1" ,
674696 }
675697 session_info = SessionDetails .fromJson (session_details )
676698
@@ -684,6 +706,8 @@ def test_parse_session_info() -> None:
684706 expiry_date = datetime (2022 , 1 , 1 , 0 , 0 , 0 , tzinfo = timezone .utc ),
685707 created_at = datetime (2021 , 1 , 1 , 0 , 0 , 0 , tzinfo = timezone .utc ),
686708 ttl = timedelta (days = 1 , hours = 8 , minutes = 1 , seconds = 2 ),
709+ tenant_id = "tenant-1" ,
710+ user_id = "user-1" ,
687711 )
688712
689713
@@ -696,6 +720,8 @@ def test_parse_session_info_without_optionals() -> None:
696720 "status" : "running" ,
697721 "host" : "a.b" ,
698722 "created_at" : "2021-01-01T00:00:00Z" ,
723+ "tenant_id" : "tenant-1" ,
724+ "user_id" : "user-1" ,
699725 }
700726 session_info = SessionDetails .fromJson (session_details )
701727
@@ -709,4 +735,6 @@ def test_parse_session_info_without_optionals() -> None:
709735 expiry_date = None ,
710736 ttl = None ,
711737 created_at = datetime (2021 , 1 , 1 , 0 , 0 , 0 , tzinfo = timezone .utc ),
738+ tenant_id = "tenant-1" ,
739+ user_id = "user-1" ,
712740 )
0 commit comments