

@mock.patch('boto3.resources.factory.ServiceAction')
def test_resource_lazy_properties_missing_load(self, action_cls):
    model = {
        'shape': 'TestShape',
        'identifiers': [{
            'name': 'Url',
        }],
    }
    shape = DenormalizedStructureBuilder().with_members({
        'ETag': {
            'type': 'string',
        },
        'LastModified': {
            'type': 'string',
        },
        'Url': {
            'type': 'string',
        },
    }).build_model()
    service_model = mock.Mock()
    service_model.shape_for.return_value = shape
    action = action_cls.return_value
    action.return_value = {
        'ETag': 'tag',
        'LastModified': 'never',
    }
    resource = self.load('test', model, service_model=service_model)('url')
    with self.assertRaises(ResourceLoadException):
        resource.last_modified

dataset/ETHPy150Open boto/boto3/tests/unit/resources/test_factory.py TestResourceFactory.test_resource_lazy_properties_missing_load/original