def test_record_from_asset(): arch = S3archivist(testbucket, s3=mock.Mock(), siteconfig={}) asset = arch.new_resource(key='test.key', data=asset_data) indexer = Indexer(archivist=arch) ix = indexer.record_for_asset(asset) assert ix['title'] == asset_data['title'] assert ix['published'] == asset_data['published'] assert ix['updated'] == asset_data['updated'] assert ix['category'] == asset_data['category'] assert ix['author'] == asset_data['author'] assert ix['description'] == asset_data['description'] assert ix['image'] == asset_data['image'] assert ix['monograph'] == asset_data['monograph'] assert ix['archetype'] == 'test.key' assert 'itemtype' in ix