Exemplo n.º 1
0
 def test_uk_arguments_parsing(self):
     uk = UserKeyword(_FakeTestCaseFile(), 'My User keyword')
     uk.args.value = ['${arg1}', '${arg2}=def', '@{varargs}']
     kw_info = TestCaseUserKeywordInfo(uk)
     exp_source = 'testcase.txt'
     exp_args = '[ arg1 | arg2=def | *varargs ]'
     assert_in_details(kw_info, exp_source, exp_args)
Exemplo n.º 2
0
 def _create_suite(self, suite_class, source, is_dir=False):
     suite = suite_class()
     suite.source = source
     if is_dir:
         suite.directory = source
     suite.keyword_table.keywords = [
         UserKeyword(suite.keyword_table, '%s Fake UK %d' % (suite.name, i))
         for i in range(5)]
     return suite
Exemplo n.º 3
0
 def _create_model(self):
     suite = self._create_directory_suite('/top_suite')
     suite.children = [self._create_file_suite('sub_suite_%d.txt' % i)
                       for i in range(3)]
     res = ResourceFile()
     res.source = 'resource.txt'
     res.keyword_table.keywords.append(UserKeyword(res, 'Resource Keyword'))
     library_manager = LibraryManager(':memory:')
     library_manager.create_database()
     model = ChiefController(Namespace(FakeSettings()), library_manager=library_manager)
     model._controller = TestDataDirectoryController(suite)
     rfc = ResourceFileController(res, chief_controller=model)
     model.resources.append(rfc)
     model.insert_into_suite_structure(rfc)
     return model
Exemplo n.º 4
0
 def test_resource_uk_longname(self):
     uk = UserKeyword(KeywordTable(_FakeResourceFile()), 'UK')
     kw_info = ResourceUserKeywordInfo(uk)
     self.assertEqual(kw_info.longname, 'resource.UK')