-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
45 lines (33 loc) · 1.28 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""assignment6 - tests.py
Created on Fri Aug 16 20:07:29 2019
@author: SPSjroseboom
"""
import conversions
import unittest
class TestConversions(unittest.TestCase):
def testConvertCelsiusToKelvin(self):
"""Should convert celsius into kelvin.
"""
result = conversions.convertCelsiusToKelvin(20.0)
self.assertEqual(result, 293.15)
def testConvertCelsiusToFahrenheit(self):
"""Should convert celsius into fahrenheit.
"""
result = conversions.convertCelsiusToFahrenheit(12.4)
self.assertEqual(result, 54.32)
def testConvertFahrenheitToCelsius(self):
result = conversions.convertFahrenheitToCelsius(70.0)
self.assertEqual(result, 21.11)
def testConvertFahrenheitToKelvin(self):
result = conversions.convertFahrenheitToKelvin(70.0)
self.assertEqual(result, 294.26)
def testConvertKelvinToCelsius(self):
result = conversions.convertKelvinToCelsius(200.0)
self.assertEqual(result, -73.15)
def testConvertKelvinToFahrenheit(self):
result = conversions.convertKelvinToFahrenheit(190.09)
self.assertEqual(result, -117.51)
if __name__ == '__main__':
unittest.main()