The new version of botcore adds this region: f7dc4730ad (diff-9dfab05d4ba739e097a193e8b5fa61caR13)
Which in turn, breaks moto:
```
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/__init__.py:3: in <module>
from .acm import mock_acm # noqa
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/acm/__init__.py:2: in <module>
from .models import acm_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/acm/models.py:7: in <module>
from moto.ec2 import ec2_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/__init__.py:2: in <module>
from .models import ec2_backends
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5169: in <module>
ec2_backends = {
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5170: in <dictcomp>
region.name: EC2Backend(region.name) for region in RegionsAndZonesBackend.regions
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:5083: in __init__
super(EC2Backend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:852: in __init__
super(InstanceBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1127: in __init__
super(TagBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:2368: in __init__
super(EBSBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1904: in __init__
super(SecurityGroupBackend, self).__init__()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1355: in __init__
self._load_amis()
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1362: in _load_amis
self.amis[ami_id] = Ami(self, **ami)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1313: in __init__
volume = self.ec2_backend.create_volume(15, region_name)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:2372: in create_volume
zone = self.get_zone_by_name(zone_name)
/moto-1.3.15.dev640-py2.py3-none-any.whl/moto/ec2/models.py:1713: in get_zone_by_name
for zone in self.zones[self.region_name]:
E KeyError: 'af-south-1'
```
The "request" object in CallbackResponse is the PreparedRequest send by
whatever client is used to contact the mocked moto service. This can end
up with unparsed bodies, as we added for processing presigned post
requests in #2155. This will make sure that all of the requests comming
in from mocked functions also get processed by werkzeug as if it was
running a live server.
This commit puts AST validation on the execution path. This means updates get
validated prior to being executed. There were quite a few tests that were not
working against Amazon DDB. These tests I considered broken and as such this
commit adapts them such that they pass against Amazon DDB.
test_update_item_on_map()
=> One of the SET actions would try to set a nested element by specifying the nesting on the path
rather than by putting a map as a value for a non-existent key. This got changed.
test_item_size_is_under_400KB
=> Used the keyword "item" which DDB doesn't like. Change to cont in order to keep the same sizings.
=> Secondly the size error messages differs a bit depending whether it is part of the update or part
of a put_item. For an update it should be:
Item size to update has exceeded the maximum allowed size
otherwise it is
Item size has exceeded the maximum allowed size'
test_remove_top_level_attribute
=> Used a keyword item. Use ExpressionAttributeNames
test_update_item_double_nested_remove
=> Used keywords name & first. Migrated to non-deprecated API and use ExpressionAttributeNames
test_update_item_set &
test_boto3_update_item_conditions_pass &
test_boto3_update_item_conditions_pass_because_expect_not_exists &
test_boto3_update_item_conditions_pass_because_expect_not_exists_by_compare_to_null &
test_boto3_update_item_conditions_pass_because_expect_exists_by_compare_to_not_null &
test_boto3_update_item_conditions_fail &
test_boto3_update_item_conditions_fail_because_expect_not_exists &
test_boto3_update_item_conditions_fail_because_expect_not_exists_by_compare_to_null
=> Were broken tests which had string literal instead of value placeholder
Part of structured approach for UpdateExpressions:
1) Expression gets parsed into a tokenlist (tokenized)
2) Tokenlist get transformed to expression tree (AST)
3) The AST gets validated (full semantic correctness) -> this commit
4) AST gets processed to perform the update
This commit uses the AST to perform validation. Validation makes sure the
nodes encounterd have valid values and they will also resolve values for
references that refer to item state or values passed into the expression.