diff --git a/hadcrut5lib_tests.py.SAVE b/hadcrut5lib_tests.py.SAVE deleted file mode 100755 index a0f618d..0000000 --- a/hadcrut5lib_tests.py.SAVE +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python3 - -# HadCRUT5 - Unit tests -# Copyright (C) 2022 Davide Madrisan -# SPDX-License-Identifier: GPL-3.0-or-later - -""" -HadCRUT5 Unit tests. -""" - -from hadcrut5lib import HadCRUT5 - -def ensure(expression, message, *argv): - if not expression: - raise AssertionError(message) - else: - print(" * {}... ok".format(message)) - -def test_class_hadcrut5(): - """Test the class 'HadCRUT5' """ - - print("Running the tests for the class 'HadCRUT5'...") - - - # load the default dataset - hc5 = HadCRUT5() - hc5.datasets_load() - - ensure(hc5.dataset_datatype == "annual", "the default dataset is 'annual'") - ensure(hc5.dataset_period == "1961-1990", - "the default period is '1961-1990'") - - d = {"Global": 0} - ensure(hc5.datasets_regions() == d.keys(), "the default region is 'Global'") - - y = hc5.dataset_years() - ensure(y[0] == 1850, "the first year of dataset_years() is 1850") - - ensure(not hc5.is_monthly_dataset, - "the default dataset type is the yearly") - - # load all datasets - hc5 = HadCRUT5(regions=(True, True, True)) - hc5.datasets_load() - - -def tests(): - test_class_hadcrut5()