コード例 #1
0
 def test_configuration_invalid(self, _):
     """Test adapter name pattern parsing."""
     backend = BluepyBackend(adapter='somestring')
     with self.assertRaises(BluetoothBackendException):
         backend.connect(TEST_MAC)
コード例 #2
0
ファイル: test_bluepy.py プロジェクト: Gezzo42/btlewrap
 def test_supports_scanning(self):
     """Check if scanning is set correctly."""
     backend = BluepyBackend()
     self.assertTrue(backend.supports_scanning())
コード例 #3
0
ファイル: test_bluepy.py プロジェクト: Gezzo42/btlewrap
 def test_check_backend_ok(self):
     """Test check_backend successfully."""
     self.assertTrue(BluepyBackend.check_backend())
コード例 #4
0
ファイル: test_bluepy.py プロジェクト: Gezzo42/btlewrap
 def test_connect_exception(self, mock_peripheral):
     """Test exception wrapping."""
     mock_peripheral.side_effect = BTLEException('Test')
     backend = BluepyBackend()
     with self.assertRaises(BluetoothBackendException):
         backend.connect(TEST_MAC)
コード例 #5
0
 def test_connect_exception(self, _):
     """Test exception wrapping."""
     backend = BluepyBackend()
     with self.assertRaises(BluetoothBackendException):
         backend.connect(TEST_MAC)