def test_list_set_name(self):
     lst = List(name="my-list")
     lst.add_item("First item")
     lst.add_item("Second item")
     self.assertEqual(
         lst.html(), "<ul id='my-list'>"
         "<li>First item</li>"
         "<li>Second item</li>"
         "</ul>")
 def test_nested_lists(self):
     inner_lst = List()
     inner_lst.add_item("First item")
     inner_lst.add_item("Second item")
     self.assertEqual(
         inner_lst.html(), "<ul>"
         "<li>First item</li>"
         "<li>Second item</li>"
         "</ul>")
     outer_lst = List()
     outer_lst.add_item(inner_lst)
     self.assertEqual(
         outer_lst.html(), "<ul>"
         "<li><ul>"
         "<li>First item</li>"
         "<li>Second item</li>"
         "</ul></li>"
         "</ul>")
 def test_ordered_list(self):
     lst = List(ordered=True)
     lst.add_item("First item")
     self.assertEqual(lst.html(), "<ol>" "<li>First item</li>" "</ol>")
     lst.add_item("Second item")
     self.assertEqual(
         lst.html(), "<ol>"
         "<li>First item</li>"
         "<li>Second item</li>"
         "</ol>")
 def test_unordered_list(self):
     lst = List()
     lst.add_item("First item")
     self.assertEqual(lst.html(), "<ul>" "<li>First item</li>" "</ul>")
     lst.add_item("Second item")
     self.assertEqual(
         lst.html(), "<ul>"
         "<li>First item</li>"
         "<li>Second item</li>"
         "</ul>")
 def test_empty_list(self):
     lst = List()
     self.assertEqual(lst.html(), "")
    print "Median read count    : %d" % data.median_read_count
    print "Mean   read count    : %d" % data.mean_read_count
    print "Std    read count    : %d" % data.std_read_count
    print "Total #barcodes      : %d" % data.total_barcodes
    print "Assigned #barcodes   : %d" % data.assigned_barcodes

    # Make a HTML report
    report = Document(title="ICell8 processing summary")
    report.add_css_rule(css_rules.QC_REPORT_CSS_RULES)
    report.add_css_rule("body { border: solid 1px grey;\n"
                        "       font-size: 80%;\n"
                        "       font-family: sans-serif; }")

    # Table of contents
    toc = report.add_section("Contents", name="toc")
    toc_list = List()
    toc.add(toc_list)

    # Files
    files_info = report.add_section("Stats files")
    stats_files = "Statistics: %s" % Link(
        "[TSV]", os.path.relpath(stats_file, os.path.dirname(out_file)))
    if xlsx_file is not None:
        stats_files += " | %s" % Link(
            "[XLSX]", os.path.relpath(xlsx_file, os.path.dirname(out_file)))
    files_info.add(stats_files)
    toc_list.add_item(Link(files_info.title, files_info))

    # General info
    general_info = report.add_section("General info", name="general_info")
    tbl = Table(columns=('name', 'value'))