|
4 | 4 | from openapi_core.templating.datatypes import TemplateResult |
5 | 5 | from openapi_core.templating.paths.exceptions import OperationNotFound |
6 | 6 | from openapi_core.templating.paths.exceptions import PathNotFound |
| 7 | +from openapi_core.templating.paths.exceptions import PathsNotFound |
7 | 8 | from openapi_core.templating.paths.exceptions import ServerNotFound |
8 | 9 | from openapi_core.templating.paths.finders import APICallPathFinder |
9 | 10 | from openapi_core.testing import MockRequest |
@@ -272,6 +273,22 @@ def test_raises(self, finder): |
272 | 273 | finder.find(method, full_url) |
273 | 274 |
|
274 | 275 |
|
| 276 | +class BaseTestPathsNotFound: |
| 277 | + @pytest.fixture |
| 278 | + def spec(self, info): |
| 279 | + spec = { |
| 280 | + "info": info, |
| 281 | + } |
| 282 | + return Spec.from_dict(spec, validator=None) |
| 283 | + |
| 284 | + def test_raises(self, finder): |
| 285 | + method = "get" |
| 286 | + full_url = "http://petstore.swagger.io/resource" |
| 287 | + |
| 288 | + with pytest.raises(PathsNotFound): |
| 289 | + finder.find(method, full_url) |
| 290 | + |
| 291 | + |
275 | 292 | class TestSpecSimpleServerServerNotFound( |
276 | 293 | BaseTestServerNotFound, |
277 | 294 | BaseTestSpecServer, |
@@ -299,6 +316,14 @@ class TestSpecSimpleServerPathNotFound( |
299 | 316 | pass |
300 | 317 |
|
301 | 318 |
|
| 319 | +class TestSpecSimpleServerPathsNotFound( |
| 320 | + BaseTestPathsNotFound, |
| 321 | + BaseTestSpecServer, |
| 322 | + BaseTestSimpleServer, |
| 323 | +): |
| 324 | + pass |
| 325 | + |
| 326 | + |
302 | 327 | class TestOperationSimpleServerServerNotFound( |
303 | 328 | BaseTestServerNotFound, |
304 | 329 | BaseTestOperationServer, |
@@ -326,6 +351,14 @@ class TestOperationSimpleServerPathNotFound( |
326 | 351 | pass |
327 | 352 |
|
328 | 353 |
|
| 354 | +class TestOperationSimpleServerPathsNotFound( |
| 355 | + BaseTestPathsNotFound, |
| 356 | + BaseTestOperationServer, |
| 357 | + BaseTestSimpleServer, |
| 358 | +): |
| 359 | + pass |
| 360 | + |
| 361 | + |
329 | 362 | class TestPathSimpleServerServerNotFound( |
330 | 363 | BaseTestServerNotFound, |
331 | 364 | BaseTestPathServer, |
@@ -353,6 +386,14 @@ class TestPathSimpleServerPathNotFound( |
353 | 386 | pass |
354 | 387 |
|
355 | 388 |
|
| 389 | +class TestPathSimpleServerPathsNotFound( |
| 390 | + BaseTestPathsNotFound, |
| 391 | + BaseTestPathServer, |
| 392 | + BaseTestSimpleServer, |
| 393 | +): |
| 394 | + pass |
| 395 | + |
| 396 | + |
356 | 397 | class TestSpecSimpleServerValid( |
357 | 398 | BaseTestValid, BaseTestSpecServer, BaseTestSimplePath, BaseTestSimpleServer |
358 | 399 | ): |
@@ -428,6 +469,14 @@ class TestSpecVariableServerPathNotFound( |
428 | 469 | pass |
429 | 470 |
|
430 | 471 |
|
| 472 | +class TestSpecVariableServerPathsNotFound( |
| 473 | + BaseTestPathsNotFound, |
| 474 | + BaseTestSpecServer, |
| 475 | + BaseTestVariableServer, |
| 476 | +): |
| 477 | + pass |
| 478 | + |
| 479 | + |
431 | 480 | class TestOperationVariableServerServerNotFound( |
432 | 481 | BaseTestServerNotFound, |
433 | 482 | BaseTestOperationServer, |
@@ -455,6 +504,14 @@ class TestOperationVariableServerPathNotFound( |
455 | 504 | pass |
456 | 505 |
|
457 | 506 |
|
| 507 | +class TestOperationVariableServerPathsNotFound( |
| 508 | + BaseTestPathsNotFound, |
| 509 | + BaseTestOperationServer, |
| 510 | + BaseTestVariableServer, |
| 511 | +): |
| 512 | + pass |
| 513 | + |
| 514 | + |
458 | 515 | class TestPathVariableServerServerNotFound( |
459 | 516 | BaseTestServerNotFound, |
460 | 517 | BaseTestPathServer, |
@@ -482,6 +539,14 @@ class TestPathVariableServerPathNotFound( |
482 | 539 | pass |
483 | 540 |
|
484 | 541 |
|
| 542 | +class TestPathVariableServerPathsNotFound( |
| 543 | + BaseTestPathsNotFound, |
| 544 | + BaseTestPathServer, |
| 545 | + BaseTestVariableServer, |
| 546 | +): |
| 547 | + pass |
| 548 | + |
| 549 | + |
485 | 550 | class TestSpecVariableServerValid( |
486 | 551 | BaseTestVariableValid, |
487 | 552 | BaseTestSpecServer, |
|
0 commit comments