How to use describe_trusted_advisor_check_refresh_statuses method in localstack

Best Python code snippet using localstack_python

test_trustedadvisor.py

Source:test_trustedadvisor.py Github

copy

Full Screen

...950 gcr.return_value = ({'foo': 'bar'}, check_dt)951 res = self.cls._poll_for_refresh('abc123')952 assert res == {'foo': 'bar'}953 assert self.mock_conn.mock_calls == [954 call.describe_trusted_advisor_check_refresh_statuses(955 checkIds=['abc123']),956 call.describe_trusted_advisor_check_refresh_statuses(957 checkIds=['abc123']),958 call.describe_trusted_advisor_check_refresh_statuses(959 checkIds=['abc123']),960 call.describe_trusted_advisor_check_refresh_statuses(961 checkIds=['abc123'])962 ]963 assert gcr.mock_calls == [call(self.cls, 'abc123')]964 assert mock_sleep.mock_calls == [965 call(30), call(30), call(30)966 ]967 assert mock_dt_now.mock_calls == [968 call(), call(), call(), call(), call()969 ]970 assert mock_logger.mock_calls == [971 call.warning('Polling for TA check %s refresh...', 'abc123'),972 call.debug('Checking refresh status'),973 call.info('Refresh status: %s; sleeping 30s', 'none'),974 call.debug('Checking refresh status'),975 call.info('Refresh status: %s; sleeping 30s', 'enqueued'),976 call.debug('Checking refresh status'),977 call.info('Refresh status: %s; sleeping 30s', 'processing'),978 call.debug('Checking refresh status'),979 call.info('Refresh status: %s; done polling', 'success'),980 call.info('Done polling for check refresh'),981 call.debug('Check shows last refresh time of: %s', check_dt)982 ]983 def test_timeout(self):984 self.cls.refresh_timeout = 45985 check_dt = datetime(2016, 12, 16, hour=10, minute=30, second=12,986 tzinfo=utc)987 now_dts = [988 datetime(2016, 12, 16, hour=11, minute=30, second=0, tzinfo=utc),989 datetime(2016, 12, 16, hour=11, minute=30, second=0, tzinfo=utc),990 datetime(2016, 12, 16, hour=11, minute=30, second=30, tzinfo=utc),991 datetime(2016, 12, 16, hour=11, minute=31, second=0, tzinfo=utc),992 ]993 status = {'statuses': [{'status': 'processing'}]}994 m_s = self.mock_conn.describe_trusted_advisor_check_refresh_statuses995 with patch('%s.logger' % pbm, autospec=True) as mock_logger:996 with patch('%s.sleep' % pbm, autospec=True) as mock_sleep:997 with patch('%s._get_check_result' % pb, autospec=True) as gcr:998 with patch('%s.datetime_now' % pbm) as mock_dt_now:999 mock_dt_now.side_effect = now_dts1000 m_s.return_value = status1001 gcr.return_value = ({'foo': 'bar'}, check_dt)1002 res = self.cls._poll_for_refresh('abc123')1003 assert res == {'foo': 'bar'}1004 assert self.mock_conn.mock_calls == [1005 call.describe_trusted_advisor_check_refresh_statuses(1006 checkIds=['abc123']),1007 call.describe_trusted_advisor_check_refresh_statuses(1008 checkIds=['abc123'])1009 ]1010 assert gcr.mock_calls == [call(self.cls, 'abc123')]1011 assert mock_sleep.mock_calls == [1012 call(30), call(30)1013 ]1014 assert mock_dt_now.mock_calls == [1015 call(), call(), call(), call()1016 ]1017 assert mock_logger.mock_calls == [1018 call.warning('Polling for TA check %s refresh...', 'abc123'),1019 call.debug('Checking refresh status'),1020 call.info('Refresh status: %s; sleeping 30s', 'processing'),1021 call.debug('Checking refresh status'),1022 call.info('Refresh status: %s; sleeping 30s', 'processing'),1023 call.error('Timed out waiting for TA Check refresh; status=%s',1024 'processing'),1025 call.info('Done polling for check refresh'),1026 call.debug('Check shows last refresh time of: %s', check_dt)1027 ]1028 def test_none(self):1029 self.cls.refresh_timeout = None1030 check_dt = datetime(2016, 12, 16, hour=10, minute=30, second=12,1031 tzinfo=utc)1032 now_dt = datetime(2016, 12, 16, hour=11, minute=30, second=12,1033 tzinfo=utc)1034 statuses = [1035 {'statuses': [{'status': 'none'}]},1036 {'statuses': [{'status': 'enqueued'}]},1037 {'statuses': [{'status': 'processing'}]},1038 {'statuses': [{'status': 'none'}]}1039 ]1040 m_s = self.mock_conn.describe_trusted_advisor_check_refresh_statuses1041 with patch('%s.logger' % pbm, autospec=True) as mock_logger:1042 with patch('%s.sleep' % pbm, autospec=True) as mock_sleep:1043 with patch('%s._get_check_result' % pb, autospec=True) as gcr:1044 with patch('%s.datetime_now' % pbm) as mock_dt_now:1045 mock_dt_now.return_value = now_dt1046 m_s.side_effect = statuses1047 gcr.return_value = ({'foo': 'bar'}, check_dt)1048 res = self.cls._poll_for_refresh('abc123')1049 assert res == {'foo': 'bar'}1050 assert self.mock_conn.mock_calls == [1051 call.describe_trusted_advisor_check_refresh_statuses(1052 checkIds=['abc123']),1053 call.describe_trusted_advisor_check_refresh_statuses(1054 checkIds=['abc123']),1055 call.describe_trusted_advisor_check_refresh_statuses(1056 checkIds=['abc123']),1057 call.describe_trusted_advisor_check_refresh_statuses(1058 checkIds=['abc123'])1059 ]1060 assert gcr.mock_calls == [call(self.cls, 'abc123')]1061 assert mock_sleep.mock_calls == [1062 call(30), call(30), call(30)1063 ]1064 assert mock_dt_now.mock_calls == [1065 call(), call(), call(), call(), call()1066 ]1067 assert mock_logger.mock_calls == [1068 call.warning('Polling for TA check %s refresh...', 'abc123'),1069 call.debug('Checking refresh status'),1070 call.info('Refresh status: %s; sleeping 30s', 'none'),1071 call.debug('Checking refresh status'),...

Full Screen

Full Screen

client.py

Source:client.py Github

copy

Full Screen

...23 def describe_services(self, serviceCodeList: List = None, language: str = None) -> Dict:24 pass25 def describe_severity_levels(self, language: str = None) -> Dict:26 pass27 def describe_trusted_advisor_check_refresh_statuses(self, checkIds: List) -> Dict:28 pass29 def describe_trusted_advisor_check_result(self, checkId: str, language: str = None) -> Dict:30 pass31 def describe_trusted_advisor_check_summaries(self, checkIds: List) -> Dict:32 pass33 def describe_trusted_advisor_checks(self, language: str) -> Dict:34 pass35 def generate_presigned_url(self, ClientMethod: str = None, Params: Dict = None, ExpiresIn: int = None, HttpMethod: str = None):36 pass37 def get_paginator(self, operation_name: str = None) -> Paginator:38 pass39 def get_waiter(self, waiter_name: str = None) -> Waiter:40 pass41 def refresh_trusted_advisor_check(self, checkId: str) -> Dict:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful