コード例 #1
0
 def test_config_missing_button(self):
     """FuguRemote __init__ should throw an error if a relay is missing."""
     flawed_config = copy.deepcopy(self.fugu_config)
     del flawed_config['relays']['Power']
     del flawed_config['relays'][fugu_remote.Buttons.BACK.value]
     with self.assertRaises(errors.RelayConfigError):
         fugu_remote.FuguRemote(flawed_config, self.mock_rig)
コード例 #2
0
 def test_enter_pairing_mode(self):
     fugu = fugu_remote.FuguRemote(self.fugu_config, self.mock_rig)
     fugu_remote.PAIRING_MODE_WAIT_TIME = 0
     fugu.enter_pairing_mode()
     self.press_button_success(2)
     self.press_button_success(1)
コード例 #3
0
 def test_press_home(self):
     fugu = fugu_remote.FuguRemote(self.fugu_config, self.mock_rig)
     fugu.press_home()
     self.press_button_success(2)
コード例 #4
0
 def test_power_nc_after_setup(self):
     """Power should be NORMALLY_CLOSED after calling setup if it exists."""
     fugu = fugu_remote.FuguRemote(self.fugu_config, self.mock_rig)
     fugu.setup()
     self.assertEqual(self.mock_board.get_relay_status(0), RelayState.NC)
     pass
コード例 #5
0
 def test_config_no_issues(self):
     """FuguRemote __init__ should not throw errors for a correct config."""
     fugu_remote.FuguRemote(self.fugu_config, self.mock_rig)
コード例 #6
0
 def test_config_missing_mac_address(self):
     """FuguRemote __init__ should throw an error without a mac address."""
     flawed_config = copy.deepcopy(self.fugu_config)
     del flawed_config['mac_address']
     with self.assertRaises(errors.RelayConfigError):
         fugu_remote.FuguRemote(flawed_config, self.mock_rig)