Пример #1
0
 def test_wind_distribution(self):
     for p in self.params:
         with self.subTest():
             self.assertEqual(
                 Climate.calculate_wind_distribution(winds=p),
                 Climate.calculate_distribution(
                     data=p, limits=Climate.WIND_DIRECTION_LIMITS))
Пример #2
0
 def test_temperature_distribution(self):
     for p in self.params:
         with self.subTest():
             self.assertEqual(
                 Climate.calculate_temperature_distribution(temps=p),
                 Climate.calculate_distribution(
                     data=p, limits=Climate.TEMP_DISTRIBUTION_LIMITS))
Пример #3
0
 def test_rh_distribution(self):
     for p in self.params:
         with self.subTest():
             self.assertEqual(
                 Climate.calculate_rh_distribution(rhs=p),
                 Climate.calculate_distribution(
                     data=p, limits=Climate.RH_DISTRIBUTION_LIMITS))
Пример #4
0
 def test_above_limit(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[4, 5], limits=[0, 1, 2]),
         [0, 0, 2])
Пример #5
0
 def test_between_limits(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[1.1, 2.0], limits=[0, 1, 2]),
         [0, 2, 0])
Пример #6
0
 def test_below_limit(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[-1, -2], limits=[0, 1, 2]),
         [2, 0, 0])
Пример #7
0
 def test_none_limits(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[1, 2, 3], limits=None), None)
Пример #8
0
 def test_empty_limits(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[1, 2, 3], limits=[]), [])
Пример #9
0
 def test_none_data(self):
     self.assertEqual(
         Climate.calculate_distribution(data=None, limits=[0, 1, 2]), None)
Пример #10
0
 def test_empty_data(self):
     self.assertEqual(
         Climate.calculate_distribution(data=[], limits=[0, 1, 2]),
         [0, 0, 0])