Skip to content

Commit

Permalink
Updated test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Locustv2 committed Aug 3, 2018
1 parent b070cc2 commit 91703d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/core/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def setUp(self):
country='France'
),
is_admin=False,
user='user',
status='inactive'
)

def test_object_basic(self):
Expand All @@ -36,7 +38,7 @@ def test_object_basic(self):
self.assertEqual(self.obj.gender, 'Male')

self.assertDictEqual(self.obj.attributes, self.obj.get(
'name', 'age', 'gender', 'location', 'is_admin'))
'name', 'age', 'gender', 'location', 'is_admin', 'user', 'status'))

@mock.patch.multiple(
Object,
Expand All @@ -47,7 +49,10 @@ def test_object_basic(self):
'gender': ('gender', lambda x: int(x == 'Male')),
'city': 'location.city',
'country': ('location.country', lambda x: x.upper()),
'occupation': ('occupation', lambda x: x)
'occupation': ('occupation', lambda x: x),
'user': ('user', lambda x: x),
'admin': 'not admin',
'status': lambda: 'active'
}
)
)
Expand All @@ -60,3 +65,6 @@ def test_object_init(self):
self.assertEqual(self.obj.city, 'Paris')
self.assertEqual(self.obj.country, 'FRANCE')
self.assertEqual(self.obj.occupation, None)
self.assertEqual(self.obj.user, 'user')
self.assertEqual(self.obj.admin, None)
self.assertEqual(self.obj.status, 'inactive')

0 comments on commit 91703d9

Please sign in to comment.