Skip to content

Commit

Permalink
mock doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin O'Hanlon committed Dec 31, 2018
1 parent d03188d commit 9e1711b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
10 changes: 10 additions & 0 deletions bluedot/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,24 @@ def __init__(self,
auto_connect)

def connect(self):
"""
Connect to a Bluetooth server.
"""
self._server.mock_client_connected(self)
self._connected = True

def disconnect(self):
"""
Disconnect from a Bluetooth server.
"""
self._server.mock_client_disconnected()
self._connected = False

def mock_server_sending_data(self, data):
"""
Simulates a server sending data to the
:class:`~.btcomm.BluetoothClient`.
"""
if self._connected:
self._data_received_callback(data)

Expand Down
6 changes: 0 additions & 6 deletions docs/btcommapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ BluetoothAdapter

.. autoclass:: BluetoothAdapter

MockBluetoothServer
-------------------

.. module:: bluedot.mock

.. autoclass:: MockBluetoothServer
5 changes: 0 additions & 5 deletions docs/dotapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ BlueDotRotation
---------------

.. autoclass:: BlueDotRotation

MockBlueDot
-----------

.. autoclass:: MockBlueDot
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Table of Contents
bluedotpythonapp
dotapi
btcommapi
mockapi
protocol
build
changelog
22 changes: 22 additions & 0 deletions docs/mockapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Mock API
========
Blue Dot also contains a useful :mod:`mock` API for simulating Blue Dot and
bluetooth comms. This is useful for testing and allows for prototyping
without having to use a Blue Dot client.

.. module:: bluedot.mock

MockBlueDot
-----------

.. autoclass:: MockBlueDot

MockBluetoothServer
-------------------

.. autoclass:: MockBluetoothServer

MockBluetoothClient
-------------------

.. autoclass:: MockBluetoothClient

0 comments on commit 9e1711b

Please sign in to comment.