Skip to content

Commit

Permalink
[Communication] Phone Number Administration: Rename list_all_orders -…
Browse files Browse the repository at this point in the history
…> list_all_reservations (#15550)

* list_all_orders -> list_all_reservations

* update CHANGELOG

* flip SKIP_PHONE_NUMBER_TESTS boolean back

* update comment in async list_all_reservations
  • Loading branch information
HeliWang authored Nov 25, 2020
1 parent 96efd25 commit 35b9277
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Caller must provide one of the following:
(2) all of keywords `display_name`, `description`, `phone_plan_ids`, `area_code`, `quantity`, `location_options`
if at least one phone plan to reserve is not toll-free plans.
(3) only keyword `continuation_token` to restart a poller from a saved state.
- `list_all_orders` renamed to `list_all_reservations`.

## 1.0.0b3 (2020-11-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@ def begin_reserve_phone_numbers(
polling_method=reservation_polling)

@distributed_trace
def list_all_searches(
def list_all_reservations(
self,
**kwargs # type: Any
):
# type: (...) -> ItemPaged[PhoneNumberEntities]
"""Gets a list of all searches.
"""Gets a list of all reservations.
:keyword int skip: An optional parameter for how many entries to skip, for pagination purposes.
The default is 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,12 @@ async def begin_reserve_phone_numbers(
polling_method=reservation_polling)

@distributed_trace
def list_all_searches(
def list_all_reservations(
self,
**kwargs # type: Any
):
# type: (...) -> AsyncItemPaged[PhoneNumberEntities]
"""Gets a list of all searches.
"""Gets a list of all reservations.
:keyword int skip: An optional parameter for how many entries to skip, for pagination purposes.
The default is 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,9 @@ def test_purchase_reservation(self):
reservation_id=self.reservation_id_to_purchase
)
assert poller.result()

@pytest.mark.live_test_only
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
def test_list_reservations(self):
pages = self._phone_number_administration_client.list_all_reservations()
assert pages.next()
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,14 @@ async def test_purchase_reservation(self):
)
result = await poller.result()
assert result

@AsyncPhoneNumberCommunicationTestCase.await_prepared_test
@pytest.mark.live_test_only
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
async def test_list_reservations(self):
async with self._phone_number_administration_client:
pages = self._phone_number_administration_client.list_all_reservations()
items = []
async for item in pages:
items.append(item)
assert len(items) > 0

0 comments on commit 35b9277

Please sign in to comment.