lundi 21 septembre 2020

trying to run test case as bewlow I am using python 3.7

def test_handler_maximal_size_of_file_to_reinject_not_number(self, mock_s3client, mock_config, mock_catalog_client,
                                                        mock_reinject_items_from_processing_failed,
                                                        mock_handle_folder, mock_reinject_data_sets):
    mock_catalog_client.return_value.get_all_datasets.return_value = self.datasets
    mock_s3client.return_value = mock_s3client
    mock_config.return_value = mock_config
    mock_config.return_value.data_bucket = "bucket_test"
    mock_config.return_value.master_key = "kms_key"
    with self.assertRaises(Exception) as context:
        handler(None,None)
    self.assertTrue('Invalid literal for Decimal:' in context.exception.message)

but getting error as :

Error
Traceback (most recent call last):
  File "/usr/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/home/nice/code/data-lake-s3-monitor-lambda/ven3.7/lib/python3.7/site-packages/mock/mock.py", line 1747, in _inner
    return f(*args, **kw)
  File "/home/nice/code/data-lake-s3-monitor-lambda/ven3.7/lib/python3.7/site-packages/mock/mock.py", line 1330, in patched
    return func(*args, **keywargs)
  File "/home/nice/code/data-lake-s3-monitor-lambda/tests/unit/test_datalake_s3_rejected_data.py", line 342, in test_handler_maximal_size_of_file_to_reinject_not_number
    self.assertTrue('Invalid literal for Decimal:' in context.exception.message)
AttributeError: 'InvalidOperation' object has no attribute 'message'

Using python 3.7

Aucun commentaire:

Enregistrer un commentaire