예제 #1
0
 def __init__(self, table_dir, index_dir, open_tab, rf_extension):
     self.table_dir = table_dir
     self.index_dir = index_dir
     self.open_tab = open_tab
     self.rf_extension = rf_extension
     self.get_doc = GetKeywordDocumentation(table_dir=table_dir,
                                            index_dir=index_dir,
                                            open_tab=open_tab)
 def test_get_table_name_from_index_with_embedding_arg_kw(self):
     _get_doc = GetKeywordDocumentation(table_dir=self.db_dir,
                                        index_dir=self.index_dir,
                                        open_tab=self.test_b_file)
     kw_details = _get_doc.get_table_name_from_index(
         '', 'Embedding arg To Keyword Name')
     self.assertEqual(kw_details.table_name, self.resource_b_table_name)
     self.assertEqual(kw_details.kw, 'Embedding ${arg} To Keyword Name')
     self.assertEqual(kw_details.kw_object_name, 'resource_b')
    def test_embedding_arg_kw_doc(self):
        _get_doc = GetKeywordDocumentation(table_dir=self.db_dir,
                                           index_dir=self.index_dir,
                                           open_tab=self.test_b_file)
        doc = _get_doc.return_documentation('',
                                            'Embedding arg To Keyword Name')
        self.assertEqual(doc, 'Keyword with embedding arg to keyword name')

        kw = ('Keyword Which Also Has Really Long Name But Not As'
              ' Long The Class Name By 1234 In Keyword')
        doc = _get_doc.return_documentation('OtherNameLib', kw)
        self.assertEqual(doc, 'Documentation is here')
 def test_get_table_name_from_index_with_test_b(self):
     _get_doc = GetKeywordDocumentation(table_dir=self.db_dir,
                                        index_dir=self.index_dir,
                                        open_tab=self.test_b_file)
     cell = ('Keyword Which Also Has Really Long Name But '
             'Not As Long The Class Name By 1234 In Keyword')
     object_name = 'OtherNameLib'
     kw_details = _get_doc.get_table_name_from_index(object_name, cell)
     self.assertEqual(kw_details.table_name, self.othernamelib_table_name)
     self.assertEqual(kw_details.kw, cell.replace('1234', '${argument}'))
     self.assertEqual(
         kw_details.kw_object_name,
         ('LibraryNameWhichIsLongerThan100CharactersButItSeemsThatIt'
          'RequiresQuiteAlotLettersInTheFileName'
          'AndIsNotGoodRealLifeExample'))
 def setUp(self):
     self.get_doc = GetKeywordDocumentation(table_dir=self.db_dir,
                                            index_dir=self.index_dir,
                                            open_tab=self.test_a_file)