def poke(self, context): self.log.info( 'Poking for blob: %s\nin wasb://%s', self.blob_name, self.container_name ) hook = WasbHook(wasb_conn_id=self.wasb_conn_id) return hook.check_for_blob(self.container_name, self.blob_name, **self.check_options)
def poke(self, context): self.log.info( 'Poking for blob: %s\nin wasb://%s', self.blob_name, self.container_name ) hook = WasbHook(wasb_conn_id=self.wasb_conn_id) return hook.check_for_blob(self.container_name, self.blob_name, **self.check_options)
def test_check_for_blob(self, mock_service): mock_instance = mock_service.return_value mock_instance.exists.return_value = True hook = WasbHook(wasb_conn_id='wasb_test_sas_token') self.assertTrue(hook.check_for_blob('container', 'blob', timeout=3)) mock_instance.exists.assert_called_once_with( 'container', 'blob', timeout=3 )
def poke(self, context): logging.info( 'Poking for blob: {self.blob_name}\n' 'in wasb://{self.container_name}'.format(**locals()) ) hook = WasbHook(wasb_conn_id=self.wasb_conn_id) return hook.check_for_blob(self.container_name, self.blob_name, **self.check_options)
def test_check_for_blob(self, mock_service): mock_instance = mock_service.return_value mock_instance.exists.return_value = True hook = WasbHook(wasb_conn_id='wasb_test_sas_token') self.assertTrue(hook.check_for_blob('container', 'blob', timeout=3)) mock_instance.exists.assert_called_once_with( 'container', 'blob', timeout=3 )
def test_check_for_blob_empty(self, mock_service): mock_service.return_value.exists.return_value = False hook = WasbHook(wasb_conn_id='wasb_test_sas_token') self.assertFalse(hook.check_for_blob('container', 'blob'))
def test_check_for_blob_empty(self, mock_service): mock_service.return_value.exists.return_value = False hook = WasbHook(wasb_conn_id='wasb_test_sas_token') self.assertFalse(hook.check_for_blob('container', 'blob'))