|
8 | 8 | import pytest |
9 | 9 |
|
10 | 10 | from PowerPlatform.Dataverse.aio.data._async_batch import _AsyncBatchClient |
11 | | -from PowerPlatform.Dataverse.aio.core._async_http import _HttpResponse |
| 11 | +from PowerPlatform.Dataverse.aio.core._async_http import _AsyncResponse |
12 | 12 | from PowerPlatform.Dataverse.core.errors import MetadataError, ValidationError |
13 | 13 | from PowerPlatform.Dataverse.data._batch_base import ( |
14 | 14 | _RecordCreate, |
@@ -628,37 +628,37 @@ async def test_not_found_raises(self): |
628 | 628 |
|
629 | 629 |
|
630 | 630 | # --------------------------------------------------------------------------- |
631 | | -# _HttpResponse |
| 631 | +# _AsyncResponse |
632 | 632 | # --------------------------------------------------------------------------- |
633 | 633 |
|
634 | 634 |
|
635 | 635 | class TestHttpResponse: |
636 | | - """Tests for _HttpResponse — the materialized response returned by _AsyncHttpClient.""" |
| 636 | + """Tests for _AsyncResponse — the materialized response returned by _AsyncHttpClient.""" |
637 | 637 |
|
638 | 638 | def test_json_parses_body(self): |
639 | 639 | """json() parses the body bytes as JSON.""" |
640 | | - r = _HttpResponse(200, {"Content-Type": "application/json"}, b'{"value": []}') |
| 640 | + r = _AsyncResponse(200, {"Content-Type": "application/json"}, b'{"value": []}') |
641 | 641 | assert r.json() == {"value": []} |
642 | 642 |
|
643 | 643 | def test_json_empty_body_returns_empty_dict(self): |
644 | 644 | """json() returns {} for an empty body.""" |
645 | | - r = _HttpResponse(200, {}, b"") |
| 645 | + r = _AsyncResponse(200, {}, b"") |
646 | 646 | assert r.json() == {} |
647 | 647 |
|
648 | 648 | def test_status_and_status_code_equal(self): |
649 | 649 | """status and status_code are both set and equal.""" |
650 | | - r = _HttpResponse(207, {}, b"") |
| 650 | + r = _AsyncResponse(207, {}, b"") |
651 | 651 | assert r.status == 207 |
652 | 652 | assert r.status_code == 207 |
653 | 653 |
|
654 | 654 | def test_text_decodes_body(self): |
655 | 655 | """text property decodes body bytes as UTF-8.""" |
656 | | - r = _HttpResponse(200, {}, b"body text") |
| 656 | + r = _AsyncResponse(200, {}, b"body text") |
657 | 657 | assert r.text == "body text" |
658 | 658 |
|
659 | 659 | def test_text_empty_body(self): |
660 | 660 | """text property returns empty string for empty body.""" |
661 | | - r = _HttpResponse(200, {}, b"") |
| 661 | + r = _AsyncResponse(200, {}, b"") |
662 | 662 | assert r.text == "" |
663 | 663 |
|
664 | 664 |
|
|
0 commit comments