Repository: LLNL/PyDV (language: python)

Issue:
Test suite
In Epic #225 


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml
new file mode 100644
index 0000000..b1db2d0
--- /dev/null
+++ b/.github/workflows/python-app.yml
@@ -0,0 +1,37 @@
+# This workflow will install Python dependencies, run tests and lint with a single version of Python
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Python application
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python 3.7
+      uses: actions/setup-python@v2
+      with:
+        python-version: 3.7
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install flake8 pytest
+        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+    - name: Lint with flake8
+      run: |
+        # stop the build if there are Python syntax errors or undefined names
+        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+    # - name: Test with pytest
+    # TODO: More tests coming soon
+    #   run: |
+    #     pytest --ignore tests/test_pydv_images.py
diff --git a/requirements.txt b/requirements.txt
index 473b403..d01c043 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,39 +1,33 @@
 alabaster==0.7.12
-asn1crypto==1.2.0
-Babel==2.7.0
-certifi==2019.11.28
-cffi==1.13.2
-chardet==3.0.4
-cryptography==3.3.2
+Babel==2.9.1
+certifi==2020.12.5
+chardet==4.0.0
 cycler==0.10.0
-docutils==0.15.2
-idna==2.8
-imagesize==1.1.0
+docutils==0.16
+idna==2.10
+imagesize==1.2.0
 Jinja2==2.11.3
-kiwisolver==1.1.0
+kiwisolver==1.3.1
 MarkupSafe==1.1.1
-matplotlib==3.1.1
-numpy==1.17.2
-packaging==19.2
-pycparser==2.19
-Pygments==2.7.4
-pyOpenSSL==19.1.0
-pyparsing==2.4.2
-PySocks==1.7.1
-python-dateutil==2.8.0
-pytz==2019.3
-requests==2.22.0
-scipy==1.3.1
-singledispatch==3.4.0.3
-six==1.12.0
-snowballstemmer==2.0.0
-Sphinx==2.2.2
-sphinx-rtd-theme==0.4.3
-sphinxcontrib-applehelp==1.0.1
-sphinxcontrib-devhelp==1.0.1
-sphinxcontrib-htmlhelp==1.0.2
+matplotlib==3.4.1
+numpy==1.20.2
+packaging==20.9
+Pillow==8.2.0
+Pygments==2.9.0
+pyparsing==2.4.7
+PySide2==5.15.2
+python-dateutil==2.8.1
+pytz==2021.1
+requests==2.25.1
+scipy==1.6.3
+shiboken2==5.15.2
+six==1.16.0
+snowballstemmer==2.1.0
+Sphinx==3.5.4
+sphinxcontrib-applehelp==1.0.2
+sphinxcontrib-devhelp==1.0.2
+sphinxcontrib-htmlhelp==1.0.3
 sphinxcontrib-jsmath==1.0.1
-sphinxcontrib-qthelp==1.0.2
-sphinxcontrib-serializinghtml==1.1.3
-tornado==5.1.1
-urllib3==1.25.7
+sphinxcontrib-qthelp==1.0.3
+sphinxcontrib-serializinghtml==1.1.4
+urllib3==1.26.4


Test patch:
diff --git a/pydv/tests/CTestTestfile.cmake b/pydv/tests/CTestTestfile.cmake
deleted file mode 100644
index 4270883..0000000
--- a/pydv/tests/CTestTestfile.cmake
+++ /dev/null
@@ -1,1 +0,0 @@
-ADD_TEST(pydvpy /usr/apps/python/bin/python2 -B -m unittest -v test_pydvpy)
diff --git a/pydv/tests/pydvTestCmds b/pydv/tests/pydvTestCmds
deleted file mode 100644
index cbfd3b3..0000000
--- a/pydv/tests/pydvTestCmds
+++ /dev/null
@@ -1,92 +0,0 @@
-rd tests/testData.txt
-rd 0 tests/testData.gnu
-debug on
-debug off
-debug on
-menu
-cur 1 2
-erase
-cur 1 2
-L1 a b 
-L2 a b  3.0 5.5
-del c d
-abs a
-color a blue
-color a red
-add a b
-annot FOO 3 7
-convolve a b
-copy a
-cos a
-# custom -- loads a file of custom functions -- do this later
-dashstyle b [2, 2, 4, 2]
-dataid off
-dataid on
-delannot 1
-annot BOO 3 7
-del d
-derivative a
-dy b 1
-divide a b
-divx c 2
-divy c 2
-dom 0 10
-dom de
-dx c 3
-dy c 3
-exp a
-log a
-getdomain a b
-getrange a b
-grid on
-integrate a
-linespoints a on
-getx a 0
-gety a 2.0
-j0 f
-latex off
-lnwidth b 4
-makecurve (1 2 3) (5 2 3)
-marker b . 20
-mx a 1.0
-my a 3
-my b .10
-my c .10
-recip a
-fontsize tick 20
-xlabel X
-ylabel Y
-title TEST PLOT
-fontsize xlabel 20
-fontsize ylabel 30
-fontsize title 40
-ran de
-scatter a on
-scatter a off
-cos a
-acos a
-cosh a
-acosh a
-sin a
-asin a
-sinh a
-asinh a
-smooth a
-sqr a
-sqrt a
-sqrx a
-sqrtx a
-tan a
-atan a
-tanh a
-atanh a
-a - b
-a + b
-b ** 2
-c / b
-label a atanh(A)
-ylogscale on
-ylogscale off
-ran de
-dom de
-labelcurve on
diff --git a/pydv/tests/pydv_sample.txt b/pydv/tests/pydv_sample.txt
deleted file mode 100644
index 341be50..0000000
--- a/pydv/tests/pydv_sample.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-#sys.path.append("/usr/gapps/pydv/current")
-sys.path.append("/Users/griffin28/Documents/WCI/ASQ/PDV/PyDV/pydv")
-
-import pydvpy as pydvif
-
-curves = pydvif.read("tests/testData.ult")
-
-pydvif.create_plot(curves, fname='myplot', ftype='png', fwidth=10.1, fheight=11.3, title='My Plot', xlabel='X', ylabel='Y', legend=True, stylename='ggplot')
-
diff --git a/pydv/tests/sample_script2.txt b/pydv/tests/sample_script2.txt
deleted file mode 100755
index 62d73c7..0000000
--- a/pydv/tests/sample_script2.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-sys.path.append("/usr/gapps/pydv/2.0")
-
-import pydvpy as pydvif
-
-curves = []
-
-curves.append(pydvif.span(1,10,6))
-
-curve = pydvif.makecurve([1, 2, 3, 4, 5, 10], [3, 4, 4, 5, 6, 10])
-pydvif.cos([curve])
-curve.name = 'Cosine'
-
-curves.append(curve)
-
-curves.append(pydvif.add(curves))
-
-#plot = pydvif.create_plot(curves, 'myPlot')
-
-curves[0].linestyle = 'dashed'
-pydvif.create_plot(curves, fname='myPlot', title='My Plot', xlabel='X', ylabel='Y', legend=True)
-
diff --git a/pydv/tests/testData.csv b/pydv/tests/testData.csv
deleted file mode 100644
index 51dbe22..0000000
--- a/pydv/tests/testData.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-x,y
-1,1
-2,2.1
-3,3.6
-4,5.1
-5,9
diff --git a/pydv/tests/testData.gnu b/pydv/tests/testData.gnu
deleted file mode 100644
index 1205a01..0000000
--- a/pydv/tests/testData.gnu
+++ /dev/null
@@ -1,6 +0,0 @@
-# x y
-0 0
-1 1
-2 8
-3 27
-4 64
diff --git a/pydv/tests/testData.ult b/pydv/tests/testData.ult
deleted file mode 100644
index 1d73c53..0000000
--- a/pydv/tests/testData.ult
+++ /dev/null
@@ -1,12 +0,0 @@
-# darkness
-0 0 
-1 1 
-2 0
-3 9
-4 16
-# lightness
-0 5
-1 4
-2 2.5
-3 2.1
-4 2.0
diff --git a/pydv/tests/testData2.txt b/pydv/tests/testData2.txt
deleted file mode 100644
index c64b665..0000000
--- a/pydv/tests/testData2.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# 1 x vs time min-x max-x min-y max-y file-A 
-1 0
-1 1
-1 4
-1 9
-1 16
-# 1 x vs time min-x max-x min-y max-y file-B 
-0 5
-1 4
-2 2.5
-3 2.1
-4 2.0
diff --git a/pydv/tests/testPC.txt b/pydv/tests/testPC.txt
deleted file mode 100644
index bb99b57..0000000
--- a/pydv/tests/testPC.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# pointwise 
-0 0
-1 1
-2 2
-# histogram 
-0 1
-1 2
-2
-# baseline
-0 1
-1 1
-1 2
-2 2
diff --git a/pydv/tests/testPDV b/pydv/tests/testPDV
deleted file mode 100644
index 592088d..0000000
--- a/pydv/tests/testPDV
+++ /dev/null
@@ -1,86 +0,0 @@
-rd testData.txt
-rd 0 testData.gnu
-debug on
-debug off
-debug on
-menu
-cur 1 2
-erase
-cur 1 2
-L1 a b 
-L2 a b  3.0 5.5
-del c d
-abs a
-color a blue
-color a red
-add a b
-annot FOO 3 7
-convolve a b
-copy a
-cos a
-# custom -- loads a file of custom functions -- do this later
-dashstyle b [2, 2, 4, 2]
-dataid off
-dataid on
-delannot 1
-annot BOO 3 7
-del d
-derivative a
-dy b 1
-divide a b
-divx c 2
-divy c 2
-dom 0 10
-dom de
-dx c 3
-dy c 3
-exp a
-log a
-getdomain a b
-getrange a b
-grid on
-integrate a
-linespoints a on
-getx a 0
-gety a 2.0
-j0 f
-latex off
-lnwidth b 4
-makecurve (1 2 3) (5 2 3)
-marker b . 20
-mx a 1.0
-my a 3
-my b .10
-my c .10
-recip a
-fontsize tick 20
-xlabel X
-ylabel Y
-title TEST PLOT
-fontsize xlabel 20
-fontsize ylabel 30
-fontsize title 40
-ran de
-scatter a on
-scatter a off
-cos a
-acos a
-cosh a
-acosh a
-sin a
-asin a
-sinh a
-asinh a
-smooth a
-sqr a
-sqrt a
-sqrx a
-sqrtx a
-tan a
-atan a
-tanh a
-atanh a
-ylogscale on
-ylogscale off
-ran de
-dom de
diff --git a/pydv/tests/test_pydvpy.py b/pydv/tests/test_pydvpy.py
deleted file mode 100644
index 03883fb..0000000
--- a/pydv/tests/test_pydvpy.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# Copyright (c) 2011-2016, Lawrence Livermore National Security, LLC.
-# Produced at the Lawrence Livermore National Laboratory
-# Written by Mason Kwiat, Douglas S. Miller, and Kevin Griffin
-# e-mail: dougmiller@llnl.gov or griffin28@llnl.gov
-# LLNL-CODE-507071
-# All rights reserved.
-
-# This file is part of PDV.  For details, see <URL describing code and
-# how to download source>. Please also read "Additional BSD Notice".
-
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-
-# Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the disclaimer below.
-# Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the disclaimer (as noted below)
-# in the documentation and/or other materials provided with the
-# distribution.  Neither the name of the LLNS/LLNL nor the names of
-# its contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL LAWRENCE
-# LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-
-# Additional BSD Notice
-
-# 1. This notice is required to be provided under our contract with
-# the U.S.  Department of Energy (DOE).  This work was produced at
-# Lawrence Livermore National Laboratory under Contract
-# No. DE-AC52-07NA27344 with the DOE.
-
-# 2. Neither the United States Government nor Lawrence Livermore
-# National Security, LLC nor any of their employees, makes any
-# warranty, express or implied, or assumes any liability or
-# responsibility for the accuracy, completeness, or usefulness of any
-# information, apparatus, product, or process disclosed, or represents
-# that its use would not infringe privately-owned rights.
-
-# 3.  Also, reference herein to any specific commercial products,
-# process, or services by trade name, trademark, manufacturer or
-# otherwise does not necessarily constitute or imply its endorsement,
-# recommendation, or favoring by the United States Government or
-# Lawrence Livermore National Security, LLC.  The views and opinions
-# of authors expressed herein do not necessarily state or reflect
-# those of the United States Government or Lawrence Livermore National
-# Security, LLC, and shall not be used for advertising or product
-# endorsement purposes.
-
-import sys
-sys.path.append("../")
-import os
-import os.path
-
-import unittest
-import pydvpy as pydvif
-
-class Test_PYPDVPY(unittest.TestCase):
-    def setUp(self):
-        self.x = [1, 2, 3, 4]
-        self.y = [5, 6, 7, 8]
-        self.plotfname = 'myPlot'
-        self.ftype = 'png'
-        self.fullfname = self.plotfname + '.' + self.ftype
-
-    def tearDown(self):
-        self.x = None
-        self.y = None
-
-    def test_span(self):
-        c = pydvif.span(1, 10, 10)
-        self.assertEqual(10, len(c.x))
-
-    def test_makecurve(self):
-        c = pydvif.makecurve(self.x, self.y, 'Line', 'myfile')
-        self.assertEqual(c.name, 'Line')
-        self.assertEqual(c.filename, 'myfile')
-        self.assertEqual(len(c.x), 4)
-        self.assertEqual(len(c.y), 4)
-
-    def test_create_plot(self):
-        self.assertTrue(True)
-        # curves = pydvif.read('testData.txt')
-        # pydvif.create_plot(curves, fname=self.plotfname, ftype=self.ftype, title='My Title',
-        #                    xlabel='X', ylabel='Y', legend=True, stylename='ggplot', xls=True, yls=True)
-        # self.assertTrue(os.path.isfile(self.fullfname))
-        # os.remove(self.fullfname)
-
-
-    def test_save(self):
-        c = pydvif.makecurve(self.x, self.y, 'Line', 'myfile')
-        pydvif.save('mysave.txt', c)
-        self.assertTrue(os.path.isfile('mysave.txt'))
-        os.remove('mysave.txt')
-
-    def test_savecsv(self):
-        c = pydvif.makecurve(self.x, self.y, 'Line', 'myfile')
-        pydvif.savecsv('mysave.csv', c)
-        self.assertTrue(os.path.isfile('mysave.csv'))
-        os.remove('mysave.csv')
-
-    def test_read(self):
-        curves = pydvif.read('testData.txt')
-        self.assertEqual(len(curves), 2)
-        self.assertEqual(curves[0].name, 'darkness')
-        self.assertEqual(curves[1].name, 'lightness')
-
-    def test_readcsv(self):
-        curves = pydvif.readcsv('testData.csv')
-        self.assertEqual(len(curves), 1)
-        self.assertEqual(len(curves[0].x), 5)
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/tests/baseline/test_image_01.png b/tests/baseline/test_image_01.png
new file mode 100644
index 0000000..0a98956
Binary files /dev/null and b/tests/baseline/test_image_01.png differ
diff --git a/tests/baseline/test_image_02.png b/tests/baseline/test_image_02.png
new file mode 100644
index 0000000..ceb378e
Binary files /dev/null and b/tests/baseline/test_image_02.png differ
diff --git a/tests/baseline/test_image_03.png b/tests/baseline/test_image_03.png
new file mode 100644
index 0000000..6c9d2aa
Binary files /dev/null and b/tests/baseline/test_image_03.png differ
diff --git a/tests/baseline/test_image_04.png b/tests/baseline/test_image_04.png
new file mode 100644
index 0000000..4912bdb
Binary files /dev/null and b/tests/baseline/test_image_04.png differ
diff --git a/tests/baseline/test_image_05.png b/tests/baseline/test_image_05.png
new file mode 100644
index 0000000..c5b6d59
Binary files /dev/null and b/tests/baseline/test_image_05.png differ
diff --git a/tests/baseline/test_image_06.png b/tests/baseline/test_image_06.png
new file mode 100644
index 0000000..ceb378e
Binary files /dev/null and b/tests/baseline/test_image_06.png differ
diff --git a/tests/baseline/test_image_07.png b/tests/baseline/test_image_07.png
new file mode 100644
index 0000000..db582cc
Binary files /dev/null and b/tests/baseline/test_image_07.png differ
diff --git a/tests/baseline/test_image_08.png b/tests/baseline/test_image_08.png
new file mode 100644
index 0000000..91be6da
Binary files /dev/null and b/tests/baseline/test_image_08.png differ
diff --git a/tests/baseline/test_image_09.png b/tests/baseline/test_image_09.png
new file mode 100644
index 0000000..bccc1c2
Binary files /dev/null and b/tests/baseline/test_image_09.png differ
diff --git a/tests/baseline/test_image_10.png b/tests/baseline/test_image_10.png
new file mode 100644
index 0000000..c11757b
Binary files /dev/null and b/tests/baseline/test_image_10.png differ
diff --git a/tests/baseline/test_image_11.png b/tests/baseline/test_image_11.png
new file mode 100644
index 0000000..4c353fc
Binary files /dev/null and b/tests/baseline/test_image_11.png differ
diff --git a/tests/baseline/test_image_12.png b/tests/baseline/test_image_12.png
new file mode 100644
index 0000000..5219851
Binary files /dev/null and b/tests/baseline/test_image_12.png differ
diff --git a/tests/baseline/test_image_13.png b/tests/baseline/test_image_13.png
new file mode 100644
index 0000000..cd5d40a
Binary files /dev/null and b/tests/baseline/test_image_13.png differ
diff --git a/tests/baseline/test_image_14.png b/tests/baseline/test_image_14.png
new file mode 100644
index 0000000..fce4c75
Binary files /dev/null and b/tests/baseline/test_image_14.png differ
diff --git a/tests/baseline/test_image_15.png b/tests/baseline/test_image_15.png
new file mode 100644
index 0000000..d9500c7
Binary files /dev/null and b/tests/baseline/test_image_15.png differ
diff --git a/tests/baseline/test_image_16.png b/tests/baseline/test_image_16.png
new file mode 100644
index 0000000..5a3f5ed
Binary files /dev/null and b/tests/baseline/test_image_16.png differ
diff --git a/tests/baseline/test_image_17.png b/tests/baseline/test_image_17.png
new file mode 100644
index 0000000..1de1439
Binary files /dev/null and b/tests/baseline/test_image_17.png differ
diff --git a/tests/baseline/test_image_18.png b/tests/baseline/test_image_18.png
new file mode 100644
index 0000000..ab94e09
Binary files /dev/null and b/tests/baseline/test_image_18.png differ
diff --git a/tests/baseline/test_image_19.png b/tests/baseline/test_image_19.png
new file mode 100644
index 0000000..aadc1cd
Binary files /dev/null and b/tests/baseline/test_image_19.png differ
diff --git a/tests/baseline/test_image_20.png b/tests/baseline/test_image_20.png
new file mode 100644
index 0000000..d668477
Binary files /dev/null and b/tests/baseline/test_image_20.png differ
diff --git a/tests/baseline/test_image_21.png b/tests/baseline/test_image_21.png
new file mode 100644
index 0000000..2861ee5
Binary files /dev/null and b/tests/baseline/test_image_21.png differ
diff --git a/tests/baseline/test_image_22.png b/tests/baseline/test_image_22.png
new file mode 100644
index 0000000..d668477
Binary files /dev/null and b/tests/baseline/test_image_22.png differ
diff --git a/tests/baseline/test_image_23.png b/tests/baseline/test_image_23.png
new file mode 100644
index 0000000..ef4885b
Binary files /dev/null and b/tests/baseline/test_image_23.png differ
diff --git a/tests/baseline/test_image_24.png b/tests/baseline/test_image_24.png
new file mode 100644
index 0000000..d668477
Binary files /dev/null and b/tests/baseline/test_image_24.png differ
diff --git a/tests/baseline/test_image_25.png b/tests/baseline/test_image_25.png
new file mode 100644
index 0000000..5d592e5
Binary files /dev/null and b/tests/baseline/test_image_25.png differ
diff --git a/tests/baseline/test_image_26.png b/tests/baseline/test_image_26.png
new file mode 100644
index 0000000..166b2c8
Binary files /dev/null and b/tests/baseline/test_image_26.png differ
diff --git a/tests/baseline/test_image_27.png b/tests/baseline/test_image_27.png
new file mode 100644
index 0000000..68c95b3
Binary files /dev/null and b/tests/baseline/test_image_27.png differ
diff --git a/tests/baseline/test_image_28.png b/tests/baseline/test_image_28.png
new file mode 100644
index 0000000..8745e4f
Binary files /dev/null and b/tests/baseline/test_image_28.png differ
diff --git a/tests/baseline/test_image_29.png b/tests/baseline/test_image_29.png
new file mode 100644
index 0000000..c6f7a45
Binary files /dev/null and b/tests/baseline/test_image_29.png differ
diff --git a/tests/baseline/test_image_30.png b/tests/baseline/test_image_30.png
new file mode 100644
index 0000000..fda4602
Binary files /dev/null and b/tests/baseline/test_image_30.png differ
diff --git a/tests/baseline/test_image_31.png b/tests/baseline/test_image_31.png
new file mode 100644
index 0000000..666075a
Binary files /dev/null and b/tests/baseline/test_image_31.png differ
diff --git a/tests/baseline/test_image_32.png b/tests/baseline/test_image_32.png
new file mode 100644
index 0000000..bf9c84e
Binary files /dev/null and b/tests/baseline/test_image_32.png differ
diff --git a/tests/baseline/test_image_33.png b/tests/baseline/test_image_33.png
new file mode 100644
index 0000000..1ddc8d4
Binary files /dev/null and b/tests/baseline/test_image_33.png differ
diff --git a/tests/baseline/test_image_34.png b/tests/baseline/test_image_34.png
new file mode 100644
index 0000000..4baaf26
Binary files /dev/null and b/tests/baseline/test_image_34.png differ
diff --git a/tests/baseline/test_image_35.png b/tests/baseline/test_image_35.png
new file mode 100644
index 0000000..09c2b7f
Binary files /dev/null and b/tests/baseline/test_image_35.png differ
diff --git a/tests/baseline/test_image_36.png b/tests/baseline/test_image_36.png
new file mode 100644
index 0000000..05cc0b0
Binary files /dev/null and b/tests/baseline/test_image_36.png differ
diff --git a/tests/baseline/test_image_37.png b/tests/baseline/test_image_37.png
new file mode 100644
index 0000000..09c2b7f
Binary files /dev/null and b/tests/baseline/test_image_37.png differ
diff --git a/tests/baseline/test_image_38.png b/tests/baseline/test_image_38.png
new file mode 100644
index 0000000..ddb501b
Binary files /dev/null and b/tests/baseline/test_image_38.png differ
diff --git a/tests/baseline/test_image_39.png b/tests/baseline/test_image_39.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_39.png differ
diff --git a/tests/baseline/test_image_40.png b/tests/baseline/test_image_40.png
new file mode 100644
index 0000000..346b8f8
Binary files /dev/null and b/tests/baseline/test_image_40.png differ
diff --git a/tests/baseline/test_image_41.png b/tests/baseline/test_image_41.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_41.png differ
diff --git a/tests/baseline/test_image_42.png b/tests/baseline/test_image_42.png
new file mode 100644
index 0000000..5092ea0
Binary files /dev/null and b/tests/baseline/test_image_42.png differ
diff --git a/tests/baseline/test_image_43.png b/tests/baseline/test_image_43.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_43.png differ
diff --git a/tests/baseline/test_image_44.png b/tests/baseline/test_image_44.png
new file mode 100644
index 0000000..c20a1cf
Binary files /dev/null and b/tests/baseline/test_image_44.png differ
diff --git a/tests/baseline/test_image_45.png b/tests/baseline/test_image_45.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_45.png differ
diff --git a/tests/baseline/test_image_46.png b/tests/baseline/test_image_46.png
new file mode 100644
index 0000000..87343c3
Binary files /dev/null and b/tests/baseline/test_image_46.png differ
diff --git a/tests/baseline/test_image_47.png b/tests/baseline/test_image_47.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_47.png differ
diff --git a/tests/baseline/test_image_48.png b/tests/baseline/test_image_48.png
new file mode 100644
index 0000000..b6341b4
Binary files /dev/null and b/tests/baseline/test_image_48.png differ
diff --git a/tests/baseline/test_image_49.png b/tests/baseline/test_image_49.png
new file mode 100644
index 0000000..cbc594c
Binary files /dev/null and b/tests/baseline/test_image_49.png differ
diff --git a/tests/baseline/test_image_50.png b/tests/baseline/test_image_50.png
new file mode 100644
index 0000000..161518b
Binary files /dev/null and b/tests/baseline/test_image_50.png differ
diff --git a/tests/baseline/test_image_51.png b/tests/baseline/test_image_51.png
new file mode 100644
index 0000000..5092ea0
Binary files /dev/null and b/tests/baseline/test_image_51.png differ
diff --git a/tests/baseline/test_image_52.png b/tests/baseline/test_image_52.png
new file mode 100644
index 0000000..ee23610
Binary files /dev/null and b/tests/baseline/test_image_52.png differ
diff --git a/tests/baseline/test_image_53.png b/tests/baseline/test_image_53.png
new file mode 100644
index 0000000..81aa85f
Binary files /dev/null and b/tests/baseline/test_image_53.png differ
diff --git a/tests/baseline/test_image_54.png b/tests/baseline/test_image_54.png
new file mode 100644
index 0000000..561f223
Binary files /dev/null and b/tests/baseline/test_image_54.png differ
diff --git a/pydv/tests/testData.txt b/tests/testData.txt
old mode 100644
new mode 100755
similarity index 100%
rename from pydv/tests/testData.txt
rename to tests/testData.txt
diff --git a/tests/test_pydv_images.py b/tests/test_pydv_images.py
new file mode 100644
index 0000000..01454c1
--- /dev/null
+++ b/tests/test_pydv_images.py
@@ -0,0 +1,400 @@
+
+import os
+import shutil
+import subprocess
+
+from matplotlib import image
+from numpy import testing as np
+
+TEST_DIR = os.path.dirname(os.path.abspath(__file__))
+PYDV_DIR = os.path.dirname(TEST_DIR)
+BASELINE_DIR = os.path.join(TEST_DIR, 'baseline')
+
+# ------------------------ #
+# --- Prepare the data --- #
+# ------------------------ #
+
+# The output directory will store the generated images to compare against the baseline
+output_dir = os.path.join(TEST_DIR, 'output')
+if os.path.exists(output_dir):
+    shutil.rmtree(output_dir)
+os.makedirs(output_dir)
+
+# Generate a list of commands for PyDV to process. Between each command, we will
+# place an "image" statement, which will cause PyDV to save the current state of
+# the plot.
+commands = [
+f"""rd {os.path.join(TEST_DIR, "testData.txt")}
+cur 1 2""",
+"legend off",
+"erase",
+"""cur 1 2
+L1 a b""",
+"L2 a b  3.0 5.5",
+"del c d",
+"color a blue",
+"color a red",
+"add a b",
+"annot FOO 3 7",
+"convolve a b",
+"""del d
+copy a""",
+"cos a",
+"""del d
+dashstyle b [2, 2, 4, 2]""",
+"dataid off",
+"""dataid on
+delannot 1""",
+"derivative a",
+"""del d
+dy b 2.5
+dx b 3""",
+"""dx b -3
+divide c a""",
+"""del d
+divx c 2
+divy c 2""",
+"dom 0 10",
+"dom de",
+"exp a",
+"log a",
+"grid off",
+"""grid on
+integrate a""",
+"""del d
+linespoints a on
+marker a . 20""",
+"lnwidth b 10",
+"""lnwidth b 3
+makecurve (1 2 3) (5 2 3)""",
+"""del d
+mx c 2""",
+"my a 3",
+"recip a",
+"scatter b on",
+"""scatter b off
+cos b""",
+"acos b",
+"cosh b",
+"acosh b",
+"sin c",
+"asin c",
+"sinh c",
+"asinh c",
+"sqr b",
+"sqrt b",
+"sqrx b",
+"sqrtx b",
+"tan a",
+"atan a",
+"tanh a",
+"atanh a",
+"a - b",
+"""del d
+b ** 2""",
+"c / b",
+"smooth d",
+"""dy d -3
+abs d"""
+]
+commands_file = os.path.join(output_dir, 'pydv_commands')
+with open(commands_file, 'w') as fp:
+    for i, command in enumerate(commands):
+        image_file = os.path.join(output_dir, f"test_image_{i+1:02d}")
+        fp.write(command)
+        fp.write(f"\nimage {image_file} png\n\n")
+    fp.write("\nquit")
+
+# Execute PyDv
+exec_command = f"{os.path.join(PYDV_DIR, 'pydv', 'pdv')} -i {commands_file}"
+process = subprocess.Popen(exec_command.split(), stdout=subprocess.PIPE)
+output, error = process.communicate()
+
+
+
+# ----------------- #
+# --- Run tests --- #
+# ----------------- #
+
+# Helper text to generate the below tests for pytest
+# with open('delete_me.txt', 'w') as fp:
+#     for i in range(54):
+#         filename = f"test_image_{i+1:02d}.png"
+#         statement=f"""
+# def test_image_{i+1:02d}():
+#     baseline = image.imread(os.path.join(BASELINE_DIR, '{filename}'))
+#     output = image.imread(os.path.join(output_dir, '{filename}'))
+#     np.assert_equal(baseline, output)
+# """
+#         fp.write(statement)
+#         statement = ''
+
+def test_image_01():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_01.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_01.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_02():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_02.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_02.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_03():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_03.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_03.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_04():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_04.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_04.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_05():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_05.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_05.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_06():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_06.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_06.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_07():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_07.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_07.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_08():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_08.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_08.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_09():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_09.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_09.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_10():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_10.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_10.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_11():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_11.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_11.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_12():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_12.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_12.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_13():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_13.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_13.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_14():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_14.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_14.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_15():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_15.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_15.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_16():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_16.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_16.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_17():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_17.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_17.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_18():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_18.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_18.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_19():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_19.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_19.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_20():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_20.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_20.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_21():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_21.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_21.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_22():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_22.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_22.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_23():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_23.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_23.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_24():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_24.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_24.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_25():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_25.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_25.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_26():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_26.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_26.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_27():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_27.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_27.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_28():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_28.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_28.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_29():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_29.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_29.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_30():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_30.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_30.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_31():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_31.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_31.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_32():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_32.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_32.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_33():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_33.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_33.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_34():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_34.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_34.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_35():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_35.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_35.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_36():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_36.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_36.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_37():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_37.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_37.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_38():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_38.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_38.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_39():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_39.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_39.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_40():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_40.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_40.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_41():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_41.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_41.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_42():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_42.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_42.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_43():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_43.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_43.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_44():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_44.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_44.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_45():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_45.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_45.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_46():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_46.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_46.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_47():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_47.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_47.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_48():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_48.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_48.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_49():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_49.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_49.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_50():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_50.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_50.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_51():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_51.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_51.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_52():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_52.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_52.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_53():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_53.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_53.png'))
+    np.assert_equal(baseline, output)
+
+def test_image_54():
+    baseline = image.imread(os.path.join(BASELINE_DIR, 'test_image_54.png'))
+    output = image.imread(os.path.join(output_dir, 'test_image_54.png'))
+    np.assert_equal(baseline, output)