Exemplo n.º 1
0
 def test_celsius_to_fahrenheit(self):
     ftemp = celsius_to_fahrenheit(100.0)
     self.assertEquals(ftemp, 212.0)
     ftemp = celsius_to_fahrenheit(0.0)
     self.assertEquals(ftemp, 32.0)
     ftemp = celsius_to_fahrenheit(-40.0)
     self.assertEquals(ftemp, -40.0)
Exemplo n.º 2
0
 def test_celsius_to_fahrenheit(self):
     ftemp = celsius_to_fahrenheit(100.0)
     self.assertEquals(ftemp, 212.0)
     ftemp = celsius_to_fahrenheit(0.0)
     self.assertEquals(ftemp, 32.0)
     ftemp = celsius_to_fahrenheit(-40.0)
     self.assertEquals(ftemp, -40.0)
Exemplo n.º 3
0
def get_temp_conversion(fahrenheit, celsius):
    """
    Convert temperature between fahrenheit and celsius
    """
    if fahrenheit:
        return round(fahrenheit_to_celsius(fahrenheit), 1)
    elif celsius:
        return round(celsius_to_fahrenheit(celsius), 1)
Exemplo n.º 4
0
def get_temp_conversion(fahrenheit, celsius):
    """
    Convert temperature between fahrenheit and celsius
    """
    if fahrenheit:
        return round(fahrenheit_to_celsius(fahrenheit), 1)
    elif celsius:
        return round(celsius_to_fahrenheit(celsius), 1)