本文整理匯總了Python中criteria.helper.criteria.Criteria.populate_container方法的典型用法代碼示例。如果您正苦於以下問題:Python Criteria.populate_container方法的具體用法?Python Criteria.populate_container怎麽用?Python Criteria.populate_container使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類criteria.helper.criteria.Criteria
的用法示例。
在下文中一共展示了Criteria.populate_container方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_populate_container
# 需要導入模塊: from criteria.helper.criteria import Criteria [as 別名]
# 或者: from criteria.helper.criteria.Criteria import populate_container [as 別名]
def test_populate_container(self):
features = ['ENSG00000110800']
diseases = ['T1D']
fid = 'GDXHsS00004'
fname = 'Barrett'
fnotes = {'linkdata': 'somedata', 'linkvalue': 'somevalue'}
result_container = Criteria.populate_container(fid, fname, fnotes, features, diseases, result_container={})
expected_result = {'ENSG00000110800': {'T1D': [{'fid': 'GDXHsS00004', 'fname': 'Barrett',
'fnotes': {'linkvalue': 'somevalue',
'linkdata': 'somedata'}}]}}
self.assertEqual(expected_result, result_container, 'Expected result from populate container')
features = ['ENSG00000110800']
diseases = ['RA']
fid = 'GDXHsS00003'
fname = 'Barrett'
fnotes = {'linkdata': 'somedata2', 'linkvalue': 'somevalue2'}
result_container_populated_again = Criteria.populate_container(fid, fname, fnotes, features, diseases,
result_container=result_container)
expected_result_populated_again = {'ENSG00000110800': {'RA': [{'fname': 'Barrett', 'fid': 'GDXHsS00003',
'fnotes': {'linkvalue': 'somevalue2',
'linkdata': 'somedata2'}}],
'T1D': [{'fname': 'Barrett', 'fid': 'GDXHsS00004',
'fnotes': {'linkvalue': 'somevalue',
'linkdata': 'somedata'}}]}}
self.assertEqual(result_container_populated_again, expected_result_populated_again,
'Expected result after populating')