52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import camelot
|
|
|
|
|
|
testdir = os.path.dirname(os.path.abspath(__file__))
|
|
testdir = os.path.join(testdir, "files")
|
|
|
|
|
|
@pytest.mark.mpl_image_compare(
|
|
baseline_dir="files/baseline_plots", remove_text=True)
|
|
def test_text_plot():
|
|
filename = os.path.join(testdir, "foo.pdf")
|
|
tables = camelot.read_pdf(filename)
|
|
return camelot.plot(tables[0], plot_type='text')
|
|
|
|
|
|
@pytest.mark.mpl_image_compare(
|
|
baseline_dir="files/baseline_plots", remove_text=True)
|
|
def test_table_plot():
|
|
filename = os.path.join(testdir, "foo.pdf")
|
|
tables = camelot.read_pdf(filename)
|
|
return camelot.plot(tables[0], plot_type='table')
|
|
|
|
|
|
@pytest.mark.mpl_image_compare(
|
|
baseline_dir="files/baseline_plots", remove_text=True)
|
|
def test_contour_plot():
|
|
filename = os.path.join(testdir, "foo.pdf")
|
|
tables = camelot.read_pdf(filename)
|
|
return camelot.plot(tables[0], plot_type='contour')
|
|
|
|
|
|
@pytest.mark.mpl_image_compare(
|
|
baseline_dir="files/baseline_plots", remove_text=True)
|
|
def test_line_plot():
|
|
filename = os.path.join(testdir, "foo.pdf")
|
|
tables = camelot.read_pdf(filename)
|
|
return camelot.plot(tables[0], plot_type='line')
|
|
|
|
|
|
@pytest.mark.mpl_image_compare(
|
|
baseline_dir="files/baseline_plots", remove_text=True)
|
|
def test_joint_plot():
|
|
filename = os.path.join(testdir, "foo.pdf")
|
|
tables = camelot.read_pdf(filename)
|
|
return camelot.plot(tables[0], plot_type='joint')
|