本文整理汇总了Python中robotide.controller.filecontrollers.TestDataDirectoryController类的典型用法代码示例。如果您正苦于以下问题:Python TestDataDirectoryController类的具体用法?Python TestDataDirectoryController怎么用?Python TestDataDirectoryController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestDataDirectoryController类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_finding_subdirectory_controller
def test_finding_subdirectory_controller(self):
directory_controller = TestDataDirectoryController(_data_directory('Root'))
subdirectory_controller = TestDataDirectoryController(_data_directory('Sub.suite'))
directory_controller.add_child(subdirectory_controller)
self.project._controller = directory_controller
result = self.project.find_controller_by_longname('Root.Sub.suite')
assert_equals(result, subdirectory_controller)
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:7,代码来源:test_chiefcontroller.py
示例2: test_exclude
def test_exclude(self):
parent = lambda:0
project = self._mock_project()
ctrl = TestDataDirectoryController(self.data, project, parent)
parent.children = [ctrl]
ctrl.exclude()
self.assertEqual(len(parent.children), 1)
self.assertTrue(parent.children[0].is_excluded())
self.assertTrue(self.called)
开发者ID:Garjy,项目名称:RIDE,代码行数:9,代码来源:test_filecontrollers.py
示例3: _create_suite_structure_with_two_tests_with_same_name
def _create_suite_structure_with_two_tests_with_same_name(self):
directory_controller = TestDataDirectoryController(_data_directory('Ro.ot'))
suite1_controller = TestCaseFileController(_testcasefile('Suite.1.txt'))
test1 = suite1_controller.create_test('Te.st')
suite2_controller = TestCaseFileController(_testcasefile('Suite.2.txt'))
test2 = suite2_controller.create_test('Te.st')
directory_controller.add_child(suite1_controller)
directory_controller.add_child(suite2_controller)
self.project._controller = directory_controller
return test1, test2
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:10,代码来源:test_chiefcontroller.py
示例4: test_reload_with_directory_suite
def test_reload_with_directory_suite(self):
model_parent = object()
controller_parent = object()
ctrl = TestDataDirectoryController(TestDataDirectory(source=self._dirpath, parent=model_parent).populate(),
parent=controller_parent)
open(self._init_path, 'a').write('... ninjaed more documentation')
ctrl.reload()
assert_equals(ctrl.settings[0].value,
'Ride unit testing file\\nninjaed more documentation')
assert_equals(ctrl.parent, controller_parent)
assert_equals(ctrl.data.parent, model_parent)
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:11,代码来源:test_modifications_on_disk.py
示例5: test_finding_correct_testcase_when_two_files_with_same_name_start
def test_finding_correct_testcase_when_two_files_with_same_name_start(self):
directory_controller = TestDataDirectoryController(_data_directory('t'))
suite1_controller = TestCaseFileController(_testcasefile('test.txt'))
test1 = suite1_controller.create_test('A')
suite2_controller = TestCaseFileController(_testcasefile('test2.txt'))
test2 = suite2_controller.create_test('A')
directory_controller.add_child(suite1_controller)
directory_controller.add_child(suite2_controller)
self.project._controller = directory_controller
result1 = self.project.find_controller_by_longname('T.'+test1.longname, test1.display_name)
assert_equals(result1, test1)
result2 = self.project.find_controller_by_longname('T.'+test2.longname, test2.display_name)
assert_equals(result2, test2)
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:13,代码来源:test_chiefcontroller.py
示例6: test_has_format
def test_has_format(self):
ctrl = TestDataDirectoryController(self.data)
assert_false(ctrl.has_format())
ctrl.mark_dirty()
assert_false(ctrl.has_format())
ctrl.data.initfile = os.path.join('source', '__init__.html')
assert_true(ctrl.has_format())
开发者ID:Garjy,项目名称:RIDE,代码行数:7,代码来源:test_filecontrollers.py
示例7: DatafileIteratorTest
class DatafileIteratorTest(unittest.TestCase):
def setUp(self):
test_data_suite = TestDataDirectory(source=SUITEPATH).populate()
self.directory_controller = TestDataDirectoryController(test_data_suite)
def test_iterate_all(self):
class Checker(object):
def __init__(self):
self.iteration_count = 0
self.in_sub_dir = False
def __call__(self, controller):
self.iteration_count += 1
print controller.filename
if controller.filename and controller.filename.endswith('test.txt'):
self.in_sub_dir = True
check_count_and_sub_dir = Checker()
[check_count_and_sub_dir(df) for df
in self.directory_controller.iter_datafiles()]
assert_true(check_count_and_sub_dir.iteration_count == 5)
assert_true(check_count_and_sub_dir.in_sub_dir)
开发者ID:Garjy,项目名称:RIDE,代码行数:21,代码来源:test_filecontrollers.py
示例8: setUp
def setUp(self):
test_data_suite = TestDataDirectory(source=SUITEPATH).populate()
self.directory_controller = TestDataDirectoryController(test_data_suite)
开发者ID:Garjy,项目名称:RIDE,代码行数:3,代码来源:test_filecontrollers.py
示例9: test_adding_test_data_directory_using_command
def test_adding_test_data_directory_using_command(self):
ctrl = TestDataDirectoryController(self.data)
suite = ctrl.execute(AddTestDataDirectory(self.INIT_FILE_PATH))
assert_equals(suite.data.parent, ctrl.data)
开发者ID:Garjy,项目名称:RIDE,代码行数:4,代码来源:test_filecontrollers.py
示例10: test_adding_test_case_file_using_command
def test_adding_test_case_file_using_command(self):
ctrl = TestDataDirectoryController(self.data)
suite = ctrl.execute(AddTestCaseFile(self.TEST_CASE_FILE_PATH))
assert_equals(suite.data.parent, ctrl.data)
开发者ID:Garjy,项目名称:RIDE,代码行数:4,代码来源:test_filecontrollers.py
示例11: test_longname
def test_longname(self):
ctrl = TestDataDirectoryController(self.data)
assert_equals(ctrl.longname, 'Source')
ctrl.parent = lambda:0
ctrl.parent.longname = 'Parent'
assert_equals(ctrl.longname, 'Parent.Source')
开发者ID:Garjy,项目名称:RIDE,代码行数:6,代码来源:test_filecontrollers.py
示例12: test_set_format
def test_set_format(self):
ctrl = TestDataDirectoryController(self.data)
assert_false(ctrl.has_format())
ctrl.set_format('txt')
assert_true(ctrl.has_format())
assert_equals(ctrl.source, os.path.abspath(os.path.join('source', '__init__.txt')))
开发者ID:Garjy,项目名称:RIDE,代码行数:6,代码来源:test_filecontrollers.py
示例13: test_mtime_with_directory_suite
def test_mtime_with_directory_suite(self):
ctrl = TestDataDirectoryController(TestDataDirectory(source=self._dirpath).populate())
assert_false(ctrl.has_been_modified_on_disk())
os.utime(self._init_path, (1,1))
assert_true(ctrl.has_been_modified_on_disk())
开发者ID:Hariprasad-ka,项目名称:RIDE,代码行数:5,代码来源:test_modifications_on_disk.py
示例14: test_reload_with_directory_suite
def test_reload_with_directory_suite(self):
ctrl = TestDataDirectoryController(TestDataDirectory(source=self._dirpath).populate())
open(self._init_path, 'a').write('... ninjaed more documentation')
ctrl.reload()
assert_equals(ctrl.settings[0].value,
'Ride unit testing file ninjaed more documentation')
开发者ID:IlfirinPL,项目名称:RIDE,代码行数:6,代码来源:test_modifcations_on_disk.py
注:本文中的robotide.controller.filecontrollers.TestDataDirectoryController类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论