本文整理汇总了Python中chiptools.core.project.Project.get_constraints方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_constraints方法的具体用法?Python Project.get_constraints怎么用?Python Project.get_constraints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chiptools.core.project.Project
的用法示例。
在下文中一共展示了Project.get_constraints方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testProjectConstraints
# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import get_constraints [as 别名]
def testProjectConstraints(self):
project = Project()
XmlProjectParser.load_project(self.project_path, project)
# Check the project constraints
self.assertEqual(
self.project_constraints,
[os.path.basename(c.path) for c in project.get_constraints()],
)
示例2: test_constraints
# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import get_constraints [as 别名]
def test_constraints(self):
project = Project()
for constraints in self.project_constraints:
project.add_constraints(constraints, flow='dummy_flow')
constraints = project.get_constraints()
self.assertEquals(
len(constraints),
len(self.project_constraints),
msg='Incorrect number of constraints added to project.'
)
self.assertTrue(
len(constraints) > 0,
msg='Not correctly tested as no constraints are present.'
)
for idx in range(len(constraints)):
self.assertEquals(
constraints[idx].path,
os.path.abspath(self.project_constraints[idx]),
msg='Constraints path was incorrectly processed.'
)