EvaluationEfficiencyOptimiz.../davisAPI/PyWeather-master/weather/stations/tests/test_station.py

18 lines
482 B
Python
Raw Normal View History

2024-10-08 17:47:23 +04:00
'''Tests for the station module.'''
import unittest
from ..station import WeatherPoint
class WeatherPointTest(unittest.TestCase):
def test_temperature_conversion(self):
w_f = WeatherPoint(temperature_f=80)
self.assertEqual(w_f.temperature_f, 80)
self.assertAlmostEqual(w_f.temperature_c, 26.666688)
w_c = WeatherPoint(temperature_c=21)
self.assertEqual(w_c.temperature_c, 21)
self.assertAlmostEqual(w_c.temperature_f, 69.8)