コード例 #1
0
def test_hyperlink(temp_file):
    out_file = temp_file()
    xlsx2html(get_fixture("hyperlinks.xlsx"),
              out_file,
              locale="en",
              parse_formula=True)
    result_html = open(out_file).read()
    assert result_html
コード例 #2
0
def test_use_streams():
    xlsx_file = open(XLSX_FILE, "rb")
    out_file = io.StringIO()
    xlsx2html(xlsx_file, out_file, locale="en")
    assert out_file.tell() > 0
    out_file.seek(0)
    result_html = out_file.read()
    assert result_html
コード例 #3
0
def test_default_output():
    xlsx_file = open(XLSX_FILE, "rb")
    out_file = xlsx2html(xlsx_file, locale="en")
    assert out_file.tell() > 0
    out_file.seek(0)
    result_html = out_file.read()
    assert result_html
コード例 #4
0
def test_screenshot_diff(temp_file, browser, screenshot_regression):
    browser.driver.set_window_size(1280, 1024)
    out_file = temp_file()
    xlsx2html(XLSX_FILE, out_file, locale="en")
    browser.visit("file://" + out_file)
    screenshot_regression()
コード例 #5
0
def test_xlsx2html(temp_file):
    out_file = temp_file()
    xlsx2html(XLSX_FILE, out_file, locale="en")
    result_html = open(out_file).read()
    assert result_html
コード例 #6
0
def test_screenshot_diff(temp_file, browser, screenshot_match):
    out_file = temp_file()
    xlsx2html(XLSX_FILE, out_file, locale='en')
    browser.visit('file://' + out_file)
    screenshot_match()
コード例 #7
0
ファイル: test_files.py プロジェクト: Manzama/xlsx2html
    def test_xls2html(self):
        xlsx2html(self.xlsx_file, self.tmp_file)
        result_html = open(self.tmp_file).read()

        self.assertEqual(result_html, self.expect_result)