Skip to content

Commit

Permalink
tests: adds additional object nesting tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lapa <chris@lapa.com.au>
  • Loading branch information
GusBricker committed Sep 20, 2018
1 parent 0904ddc commit da7170a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def test_can_write_read_multisharded_object(root_store, base_item):
class NotAShard(DyObject):
line = fields.IntField()
data = fields.StringField()
geo = fields.EmbeddedField(GeoLocation, default=GeoLocation())

class BaseMixedShards(DyObject):
TABLE_NAME = 'DynamoStoreRootDB'
Expand Down Expand Up @@ -344,6 +345,7 @@ def test_can_read_write_mixed_shard(root_store, base_item):
orig.lastname = 'smith'
orig.info.line = 100
orig.info.data = 'line data'
orig.info.geolocation = GeoLocation(lattitude='34.0', longitude='30.0')

loc1 = Location(geolocation=GeoLocation())
loc1.city = 'Vienna'
Expand Down Expand Up @@ -371,6 +373,9 @@ def test_can_read_write_mixed_shard(root_store, base_item):
assert isinstance(o.info, NotAShard)
assert orig.info.line == 100
assert orig.info.data == 'line data'
assert isinstance(o.info.geolocation, GeoLocation)
assert orig.info.geolocation.lattitude == '34.0'
assert orig.info.geolocation.longitude == '30.0'

assert isinstance(o.locations, list)
assert len(o.locations) == 2
Expand Down

0 comments on commit da7170a

Please sign in to comment.