Esempio n. 1
0
    def test_low_border_values(self):
        """
        Test that a grid cell can be created without error using low border
        values for all three variables, namely 0 for temperature, humidity,
        and albedo.
        """
        cell = GridCell(0, 0, 0)

        self.assertEqual(cell.get_temperature(), 0)
        self.assertEqual(cell.get_relative_humidity(), 0)
        self.assertEqual(cell.get_albedo(), 0)
Esempio n. 2
0
    def test_high_border_values(self):
        """
        Test that a grid cell can be created without error using high border
        values for all three variables, using 100 for humidity and 1 for
        albedo. Temperature has no high border.
        """
        cell = GridCell(987654321, 100, 1)

        self.assertEqual(cell.get_temperature(), 987654321)
        self.assertEqual(cell.get_relative_humidity(), 100)
        self.assertEqual(cell.get_albedo(), 1)
Esempio n. 3
0
    def test_valid_init(self):
        """
        Test error-free creation of a valid grid cell, and proper returns from
        getter methods.
        """
        temp = 1
        r_hum = 75
        albedo = 1

        cell = GridCell(temp, r_hum, albedo)

        self.assertEqual(cell.get_temperature(), temp)
        self.assertEqual(cell.get_relative_humidity(), r_hum)
        self.assertEqual(cell.get_albedo(), albedo)
        self.assertEqual(cell.get_temperature_change(), 0)