- Timestamp:
- Apr 22, 2019, 6:14:53 PM (5 years ago)
- Branches:
- current
- Children:
- 0dedfbe
- Parents:
- e52a502
- Location:
- ow/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/tests/models/test_root.py
re52a502 r42baca4 35 35 # a new OpenWorkouts instance has a catalog created automatically 36 36 assert isinstance(root.catalog, Catalog) 37 assert len(root.catalog) == 338 for key in ['email', 'nickname', 'sport' ]:37 assert len(root.catalog) == 4 38 for key in ['email', 'nickname', 'sport', 'hashed']: 39 39 assert key in root.catalog 40 40 41 41 def test_update_indexes(self, root): 42 42 indexes = sorted([i for i in root.catalog]) 43 assert indexes == ['email', ' nickname', 'sport']43 assert indexes == ['email', 'hashed', 'nickname', 'sport'] 44 44 # remove one index 45 45 del root.catalog['email'] 46 46 indexes = sorted([i for i in root.catalog]) 47 assert indexes == [' nickname', 'sport']47 assert indexes == ['hashed', 'nickname', 'sport'] 48 48 # now update indexes, the index will be back there 49 49 root._update_indexes() 50 50 indexes = sorted([i for i in root.catalog]) 51 assert indexes == ['email', ' nickname', 'sport']51 assert indexes == ['email', 'hashed', 'nickname', 'sport'] 52 52 53 53 def test_add_user_ok(self, root): -
ow/tests/test_catalog.py
re52a502 r42baca4 56 56 changes = update_indexes(catalog, indexes) 57 57 assert changes['added'] == ['newindex'] 58 assert changes['removed'] == ['email', 'nickname', 'sport' ]58 assert changes['removed'] == ['email', 'nickname', 'sport', 'hashed'] 59 59 60 60 def test_update_indexes_empty(self, root): … … 63 63 changes = update_indexes(catalog, indexes) 64 64 assert changes['added'] == [] 65 assert changes['removed'] == ['email', 'nickname', 'sport' ]65 assert changes['removed'] == ['email', 'nickname', 'sport', 'hashed'] 66 66 67 67 def test_install_catalog(self):
Note: See TracChangeset
for help on using the changeset viewer.