import pytest import os from datetime import datetime, timedelta from netCDF4 import Dataset import numpy as np import random import string from tests.TestUtils import TestUtils from SDToolBox.data_acquisition import OutputData class Test_create: @pytest.mark.unittest def test_when_no_dataset_given_then_exception_risen(self): output_result = None with pytest.raises(IOError) as e_info: output_result = OutputData(None, None, None, None) error_message = str(e_info.value) assert output_result is None assert error_message == 'Original dataset should be given' @pytest.mark.unittest def test_when_no_lat_values_given_then_exception_risen(self): output_result = None with pytest.raises(IOError) as e_info: output_result = OutputData(4.2, None, None, None) error_message = str(e_info.value) assert output_result is None assert error_message == 'Lateral values should be given' @pytest.mark.unittest def test_when_no_lon_values_given_then_exception_risen(self): output_result = None with pytest.raises(IOError) as e_info: output_result = OutputData(4.2, 42, None, None) error_message = str(e_info.value) assert output_result is None assert error_message == 'Longitude values should be given' @pytest.mark.unittest def test_when_no_time_values_given_then_exception_risen(self): output_result = None with pytest.raises(IOError) as e_info: output_result = OutputData(4.2, 42, 2.4, None) error_message = str(e_info.value) assert output_result is None assert error_message == 'Time values should be given' class Test_generate_gtsm_netcdf: @pytest.mark.systemtest def test_when_given_wave_cases_generates_output(self): pytest.faile('ToDo') pass