Ejemplo n.º 1
0
 def test_load_driver(self):
     configuration = {
         'driver': {
             'file': 'driver.py'
         }
     }
     mock_config = goatd.Config(configuration)
     mock_config.filename = os.path.join(self.directory, 'c.yaml')
     driver = goatd.load_driver(mock_config)
     assert driver.heading() == 2.43
Ejemplo n.º 2
0
 def test_bad_driver(self):
     self.mock_config.driver.file = os.path.join(self.directory,
                                                 'bad_driver.py')
     try:
         driver = goatd.load_driver(self.mock_config)
     except SyntaxError:
         pass
     except Exception as e:
         assert False, 'An exception other than SyntaxError was raised: {}'.format(e)
     else:
         assert False, 'No exception was raised'
Ejemplo n.º 3
0
 def test_empty_hardware(self):
     driver = goatd.load_driver(self.mock_config)
     assert len(driver.some_hardware) == 0
Ejemplo n.º 4
0
 def test_wind_speed(self):
     driver = goatd.load_driver(self.mock_config)
     heading = driver.wind_speed
     assert heading() == 25
Ejemplo n.º 5
0
 def test_heading(self):
     driver = goatd.load_driver(self.mock_config)
     heading = driver.heading
     assert heading() == 2.43
Ejemplo n.º 6
0
 def test_loading_driver(self):
     assert goatd.load_driver(self.mock_config)