diracx-testing 0.0.1a27__py3-none-any.whl → 0.0.1a31__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
diracx/testing/utils.py CHANGED
@@ -21,10 +21,15 @@ from uuid import uuid4
21
21
  import httpx
22
22
  import pytest
23
23
 
24
+ from diracx.core.models import AccessTokenPayload, RefreshTokenPayload
25
+
24
26
  if TYPE_CHECKING:
25
- from diracx.core.settings import DevelopmentSettings
26
- from diracx.routers.jobs.sandboxes import SandboxStoreSettings
27
- from diracx.routers.utils.users import AuthorizedUserInfo, AuthSettings
27
+ from diracx.core.settings import (
28
+ AuthSettings,
29
+ DevelopmentSettings,
30
+ SandboxStoreSettings,
31
+ )
32
+ from diracx.routers.utils.users import AuthorizedUserInfo
28
33
 
29
34
 
30
35
  # to get a string like this run:
@@ -92,9 +97,10 @@ def test_dev_settings() -> Generator[DevelopmentSettings, None, None]:
92
97
  def test_auth_settings(
93
98
  private_key_pem, fernet_key
94
99
  ) -> Generator[AuthSettings, None, None]:
95
- from diracx.routers.utils.users import AuthSettings
100
+ from diracx.core.settings import AuthSettings
96
101
 
97
102
  yield AuthSettings(
103
+ token_issuer=ISSUER,
98
104
  token_algorithm="EdDSA",
99
105
  token_key=private_key_pem,
100
106
  state_key=fernet_key,
@@ -128,7 +134,7 @@ def aio_moto(worker_id):
128
134
 
129
135
  @pytest.fixture(scope="session")
130
136
  def test_sandbox_settings(aio_moto) -> SandboxStoreSettings:
131
- from diracx.routers.jobs.sandboxes import SandboxStoreSettings
137
+ from diracx.core.settings import SandboxStoreSettings
132
138
 
133
139
  yield SandboxStoreSettings(
134
140
  bucket_name="sandboxes",
@@ -177,7 +183,9 @@ class ClientFactory:
177
183
  pass
178
184
 
179
185
  @staticmethod
180
- def enrich_tokens(access_payload: dict, refresh_payload: dict):
186
+ def enrich_tokens(
187
+ access_payload: AccessTokenPayload, refresh_payload: RefreshTokenPayload
188
+ ):
181
189
 
182
190
  return {"PolicySpecific": "OpenAccessForTest"}, {}
183
191
 
@@ -186,13 +194,13 @@ class ClientFactory:
186
194
  }
187
195
  database_urls = {
188
196
  e.name: "sqlite+aiosqlite:///:memory:"
189
- for e in select_from_extension(group="diracx.db.sql")
197
+ for e in select_from_extension(group="diracx.dbs.sql")
190
198
  }
191
199
  # TODO: Monkeypatch this in a less stupid way
192
200
  # TODO: Only use this if opensearch isn't available
193
201
  os_database_conn_kwargs = {
194
202
  e.name: {"sqlalchemy_dsn": "sqlite+aiosqlite:///:memory:"}
195
- for e in select_from_extension(group="diracx.db.os")
203
+ for e in select_from_extension(group="diracx.dbs.os")
196
204
  }
197
205
  BaseOSDB.available_implementations = partial(
198
206
  fake_available_osdb_implementations,
@@ -475,44 +483,42 @@ def with_config_repo(tmp_path_factory):
475
483
  "Operations": {"Defaults": {}},
476
484
  "Systems": {
477
485
  "WorkloadManagement": {
478
- "Production": {
479
- "Databases": {
480
- "JobDB": {
481
- "DBName": "xyz",
482
- "Host": "xyz",
483
- "Port": 9999,
484
- "MaxRescheduling": 3,
485
- },
486
- "JobLoggingDB": {
487
- "DBName": "xyz",
488
- "Host": "xyz",
489
- "Port": 9999,
490
- },
491
- "PilotAgentsDB": {
492
- "DBName": "xyz",
493
- "Host": "xyz",
494
- "Port": 9999,
495
- },
496
- "SandboxMetadataDB": {
497
- "DBName": "xyz",
498
- "Host": "xyz",
499
- "Port": 9999,
500
- },
501
- "TaskQueueDB": {
502
- "DBName": "xyz",
503
- "Host": "xyz",
504
- "Port": 9999,
505
- },
506
- "ElasticJobParametersDB": {
507
- "DBName": "xyz",
508
- "Host": "xyz",
509
- "Port": 9999,
510
- },
511
- "VirtualMachineDB": {
512
- "DBName": "xyz",
513
- "Host": "xyz",
514
- "Port": 9999,
515
- },
486
+ "Databases": {
487
+ "JobDB": {
488
+ "DBName": "xyz",
489
+ "Host": "xyz",
490
+ "Port": 9999,
491
+ "MaxRescheduling": 3,
492
+ },
493
+ "JobLoggingDB": {
494
+ "DBName": "xyz",
495
+ "Host": "xyz",
496
+ "Port": 9999,
497
+ },
498
+ "PilotAgentsDB": {
499
+ "DBName": "xyz",
500
+ "Host": "xyz",
501
+ "Port": 9999,
502
+ },
503
+ "SandboxMetadataDB": {
504
+ "DBName": "xyz",
505
+ "Host": "xyz",
506
+ "Port": 9999,
507
+ },
508
+ "TaskQueueDB": {
509
+ "DBName": "xyz",
510
+ "Host": "xyz",
511
+ "Port": 9999,
512
+ },
513
+ "ElasticJobParametersDB": {
514
+ "DBName": "xyz",
515
+ "Host": "xyz",
516
+ "Port": 9999,
517
+ },
518
+ "VirtualMachineDB": {
519
+ "DBName": "xyz",
520
+ "Host": "xyz",
521
+ "Port": 9999,
516
522
  },
517
523
  },
518
524
  },
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: diracx-testing
3
- Version: 0.0.1a27
3
+ Version: 0.0.1a31
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -4,8 +4,8 @@ diracx/testing/entrypoints.py,sha256=MbH0VLUQz96XPdHzb7XWFwYtWEitAqPrrGM1H1FzDLo
4
4
  diracx/testing/mock_osdb.py,sha256=hHuvmQZ3212SaSGX11dQv4ki3ZWsmqJZFYwdn6kg2MA,6029
5
5
  diracx/testing/osdb.py,sha256=m6mUBLnGOoQLTCIBie9P2GhmLMybrgzIrlIYfhF1_Ss,3230
6
6
  diracx/testing/routers.py,sha256=UW-TnikMQgcNxF5sUZD5DWoucGiCpP6s8mYmuahDiSc,979
7
- diracx/testing/utils.py,sha256=uPI7UssaOkDvaG3Lq1-A-IJCYvhQ1F_HcQsI6N6O-Bw,24417
8
- diracx_testing-0.0.1a27.dist-info/METADATA,sha256=2brBfD2ehPXTEiLTs9VuDEZfZKQREyWonT-RiVhQ52A,634
9
- diracx_testing-0.0.1a27.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
10
- diracx_testing-0.0.1a27.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
11
- diracx_testing-0.0.1a27.dist-info/RECORD,,
7
+ diracx/testing/utils.py,sha256=T3tTzEOhmibcIu6TPwvoaZ6lFgHlU0t9FDHSetKP5EI,24341
8
+ diracx_testing-0.0.1a31.dist-info/METADATA,sha256=Ccdm-KDATp86r2C5DZfnd6ma6JEYPMosMeSxKT07eto,634
9
+ diracx_testing-0.0.1a31.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
10
+ diracx_testing-0.0.1a31.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
11
+ diracx_testing-0.0.1a31.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5