예제 #1
0
def get_table_with_metadata(
        table_with_tdiv: Tuple[List[TableDictType], Tag]) -> MetadataTableType:
    table, tdiv = table_with_tdiv
    clean_name = clean_macro_table_name(pr.table_name(tdiv))
    table_description = get_table_description(tdiv)
    return {
        'name': clean_name,
        'macros': table,
        'id': pl.create_slug(clean_name),
        'description': str(table_description),
        'linkToStandard': get_short_standard_link(tdiv)
    }
예제 #2
0
 def test_get_table_description_assert_error(self):
     snippet = self.parse_html(tables.no_description)
     tdiv = snippet.find('div', class_='table')
     with pytest.raises(AssertionError):
         t.get_table_description(tdiv)
예제 #3
0
 def test_get_table_description_h5(self):
     snippet = self.parse_html(tables.h5_description)
     tdiv = snippet.find('div', class_='table')
     assert t.get_table_description(tdiv).text == 'Description'