本文整理汇总了Python中girder.models.model_base.Model._supplementFields方法的典型用法代码示例。如果您正苦于以下问题:Python Model._supplementFields方法的具体用法?Python Model._supplementFields怎么用?Python Model._supplementFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类girder.models.model_base.Model
的用法示例。
在下文中一共展示了Model._supplementFields方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testInclusionProjDictNewValue
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testInclusionProjDictNewValue(self, inclusionProjDict):
retval = Model._supplementFields(inclusionProjDict, {'newValue'})
assert retval == {
'public': True,
'access': True,
'email': True,
'login': True,
'newValue': True
}
示例2: testFalseInclusionEdgeCase
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testFalseInclusionEdgeCase(self):
fields = {
'_id': False,
'login': True,
'email': True,
'firstName': True,
'lastName': True
}
overwrittenFields = {
'_id': True,
'login': True,
'email': True,
'firstName': True,
'lastName': True
}
overwrite = {'_id', 'login'}
retval = Model._supplementFields(fields, overwrite)
assert retval == overwrittenFields
示例3: testNoneEdgeCase
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testNoneEdgeCase(self):
# Test None edge cases
retval = Model._supplementFields(None, {'access', 'public'})
assert retval is None
示例4: testExclusionProjDictOverride
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testExclusionProjDictOverride(self, exclusionProjDict, overrideFields):
retval = Model._supplementFields(exclusionProjDict, overrideFields)
assert retval == {'email': False, 'login': False}
示例5: testExclusionProjDictNewValue
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testExclusionProjDictNewValue(self, exclusionProjDict):
retval = Model._supplementFields(exclusionProjDict, {'newValue'})
assert retval == exclusionProjDict
示例6: testInclusionProjListOverride
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testInclusionProjListOverride(self, inclusionProjList, overrideFields):
retval = Model._supplementFields(inclusionProjList, overrideFields)
assert set(retval) == set(inclusionProjList)
示例7: testInclusionProjectDictOverride
# 需要导入模块: from girder.models.model_base import Model [as 别名]
# 或者: from girder.models.model_base.Model import _supplementFields [as 别名]
def testInclusionProjectDictOverride(self, inclusionProjDict, overrideFields):
copy = dict(inclusionProjDict)
retval = Model._supplementFields(inclusionProjDict, overrideFields)
assert retval == inclusionProjDict
assert inclusionProjDict == copy