self.assertTrue(self.ch.check_pixels(imagename=tinyim, loc='0,1', refval=ref, rtol=1e-05, atol=1e-08))
import matplotlib.pyplot as plt
from casatools import ctsys
from casaplotms import plotms
from casatestutils import check
from casaplotms import plotmstool as pm
datapath = ctsys.resolve("unittest/plotms/")
tinyim = ctsys.resolve("unittest/imsmooth/tiny.im")
class plotms_test_base(unittest.TestCase):
outputDir="/tmp/" + str(os.getpid()) + "/"
plotfile_jpg = "/tmp/myplot.jpg"
display = os.environ.get("DISPLAY")
ms = os.path.join(outputDir, testms)
def checkPlotfile(self, plotfileName, minSize, maxSize=None):
self.assertTrue(os.path.isfile(plotfileName), "Plot was not created")
plotSize = os.path.getsize(plotfileName)
print(plotfileName, 'file size is', plotSize)
self.assertGreater(plotSize, minSize)
self.assertLess(plotSize, maxSize)
self.assertGreater(len(self.display), 0, 'DISPLAY not set, cannot run test')
def removePlotfile(self, plotfile=None):
plotfile = self.plotfile_jpg
if os.path.exists(self.outputDir):
shutil.rmtree(self.outputDir)
if not os.path.exists(self.ms):
shutil.copytree(os.path.join(datapath, self.testms),