def test_input_file(self): '''Test for function which loads the input file''' frames = IA.input_file(image_file) assert isinstance(frames, np.ndarray), 'Output is not an array' frames = IA.input_file(video_file) assert isinstance(frames, list), 'Output is not an array' return
# import os import unittest import pandas as pd from phasIR import image_analysis as IA from phasIR import thermal_analysis as TA sample_location = pd.DataFrame({'Column': [10], 'Row': [10]}) plate_location = pd.DataFrame({ 'Plate_row': [5, 15, 5, 15], 'Plate_col': [5, 15, 5, 15] }) image_file = './phasIR/data/images/24_conical_empty_plate.png' test_image = IA.input_file(image_file) class TestSimulationTools(unittest.TestCase): def test_pixel_intensity(self): sample, plate = TA.pixel_intensity(sample_location, plate_location, [test_image]) assert isinstance(sample, list), 'sample temperature should be a list' assert isinstance(plate, list), 'plate temperature should be a list' assert len(sample) == len(plate), \ 'the plate temprature list and the sample temperature list ' +\ 'should be the same length' return def test_find_temp_peak(self): return
def test_crop_frames(self, patched_input1): frames = IA.input_file(video_file) IA.crop_frames(patched_input1, frames) assert patched_input1.called_with(12, 105, 17, 148)
def test_flip_frame(self): frames = IA.input_file(video_file) flipped_frames = IA.flip_frame(frames) assert isinstance(flipped_frames, list), 'Output is not an array' return
def test_flip_frame(self): frames = IA.input_file(image_file) assert isinstance(frames, np.ndarray), 'Output is not an array' return