def test_list_bgp_speaker_pagination(self): # List all BGP Speakers with pagination support. cmd = bgp_speaker.ListSpeakers(test_cli20.MyApp(sys.stdout), None) self.mox.StubOutWithMock(bgp_speaker.ListSpeakers, "extend_list") bgp_speaker.ListSpeakers.extend_list(mox.IsA(list), mox.IgnoreArg()) self._test_list_resources_with_pagination("bgp_speakers", cmd) self.mox.VerifyAll() self.mox.UnsetStubs()
def test_list_bgp_speaker_sort(self): # sorted list: bgp-speaker-list --sort-key name --sort-key id # --sort-key asc --sort-key desc resources = "bgp_speakers" cmd = bgp_speaker.ListSpeakers(test_cli20.MyApp(sys.stdout), None) self._test_list_resources(resources, cmd, sort_key=["name", "id"], sort_dir=["asc", "desc"])
def test_list_bgp_speaker_limit(self): # size (1000) limited list: bgp-speaker-list -P. resources = "bgp_speakers" cmd = bgp_speaker.ListSpeakers(test_cli20.MyApp(sys.stdout), None) self._test_list_resources(resources, cmd, page_size=1000)
def test_list_bgp_speaker(self): # List all BGP Speakers. resources = "bgp_speakers" cmd = bgp_speaker.ListSpeakers(test_cli20.MyApp(sys.stdout), None) self._test_list_resources(resources, cmd, True)
def test_list_bgp_speaker_pagination(self, mock_extend_list): # List all BGP Speakers with pagination support. cmd = bgp_speaker.ListSpeakers(test_cli20.MyApp(sys.stdout), None) self._test_list_resources_with_pagination("bgp_speakers", cmd) mock_extend_list.assert_called_once_with(test_cli20.IsA(list), mock.ANY)