本文整理汇总了Python中sumatra.projects.Project.new_record方法的典型用法代码示例。如果您正苦于以下问题:Python Project.new_record方法的具体用法?Python Project.new_record怎么用?Python Project.new_record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sumatra.projects.Project
的用法示例。
在下文中一共展示了Project.new_record方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_new_record_with_minimal_args_should_set_defaults
# 需要导入模块: from sumatra.projects import Project [as 别名]
# 或者: from sumatra.projects.Project import new_record [as 别名]
def test_new_record_with_minimal_args_should_set_defaults(self):
self.write_test_script("test.py")
proj = Project("test_project",
record_store=MockRecordStore(),
default_main_file="test.py",
default_executable=MockExecutable(),
default_launch_mode=MockLaunchMode(),
default_repository=MockRepository())
rec = proj.new_record()
self.assertEqual(rec.repository, proj.default_repository)
self.assertEqual(rec.main_file, "test.py")
示例2: test_new_record_with_uuid_label_generator_should_generate_unique_id
# 需要导入模块: from sumatra.projects import Project [as 别名]
# 或者: from sumatra.projects.Project import new_record [as 别名]
def test_new_record_with_uuid_label_generator_should_generate_unique_id(self):
self.write_test_script("test.py")
proj = Project("test_project",
record_store=MockRecordStore(),
default_main_file="test.py",
default_executable=MockExecutable(),
default_launch_mode=MockLaunchMode(),
default_repository=MockRepository(),
label_generator='uuid')
rec1 = proj.new_record()
rec2 = proj.new_record()
self.assertNotEqual(rec1.label, rec2.label)
示例3: test_format_records
# 需要导入模块: from sumatra.projects import Project [as 别名]
# 或者: from sumatra.projects.Project import new_record [as 别名]
def test_format_records(self):
self.write_test_script("test.py")
proj = Project("test_project",
record_store=MockRecordStore(),
default_main_file="test.py",
default_executable=MockExecutable(),
default_launch_mode=MockLaunchMode(),
default_repository=MockRepository(),
label_generator='uuid')
rec1 = proj.new_record()
rec2 = proj.new_record()
self.assertEqual(proj.format_records('text'), 'foo_labelfoo_label\nbar_labelbar_label')
self.assertEqual(proj.format_records('html'), '<ul>\n<li>foo_labelfoo_label</li>\n<li>bar_labelbar_label</li>\n</ul>')
# TODO: Find a good way to check the output of the following formatters
# (currently we only check that we can call them without errors).
proj.format_records('latex', 'long')
proj.format_records('shell')
proj.format_records('json')