Skip to content

Commit

Permalink
Add coverage for repr(meta)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Dec 19, 2014
1 parent c48ecc8 commit e31eba1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boto3/resources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, service_name, identifiers=None, client=None,
self.data = data

def __repr__(self):
return 'ResourceMeta({0}, identifiers={1})'.format(
return 'ResourceMeta(\'{0}\', identifiers={1})'.format(
self.service_name, self.identifiers)

def __eq__(self, other):
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/resources/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ def test_resource_meta_unique(self):
'Queue data should be unique to queue instance')
self.assertNotEqual(queue1.meta, 'bad-value')

def test_resource_meta_repr(self):
queue_cls = self.load('test', 'Queue', {}, {}, None)
queue = queue_cls()
self.assertEqual(repr(queue.meta),
'ResourceMeta(\'test\', identifiers=[])')

@mock.patch('boto3.resources.factory.ServiceAction')
def test_resource_calls_action(self, action_cls):
model = {
Expand Down

0 comments on commit e31eba1

Please # to comment.