Skip to content

Commit

Permalink
FIX: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marionleborgne committed Aug 28, 2018
1 parent 82c2fac commit ce580da
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Installing from source

Running the tests
-----------------

Analytics modules need to be installed prior to running the tests. See instalation section.
::

python setup.py test
Expand Down
1 change: 0 additions & 1 deletion requirements/analytics.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
scipy==0.18.1
numpy==1.11.2
mne==0.10.0
1 change: 1 addition & 0 deletions requirements/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ simplejson==3.8.2
pika==0.11.0
requests[security]==2.18.1
pyserial==2.7
numpy==1.11.2
13 changes: 13 additions & 0 deletions tests/unit/openbci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ def inWaiting(self):
return False


class MockHTTPResponse(object):

status_code = 200

def json(self):
return {'vhost': 'mock_vhost'}


def mock_requests_get(vhost_info_url, verify):
return MockHTTPResponse()


def mock_start(self, callback_functions):
"""
Expand Down Expand Up @@ -133,6 +144,7 @@ def test_OpenBCIConnector(self):
board.start(callbacks)


@patch('requests.get', mock_requests_get)
@patch('pika.BlockingConnection', MockBlockingConnection)
def test_PikaPublisher(self):

Expand Down Expand Up @@ -171,6 +183,7 @@ def test_PikaPublisher(self):
self.assertEqual(published_message, expected_message)


@patch('requests.get', mock_requests_get)
@patch('serial.Serial', MockSerial)
@patch('pika.BlockingConnection', MockBlockingConnection)
@patch('cloudbrain.connectors.openbci.OpenBCIConnector.start',
Expand Down

0 comments on commit ce580da

Please sign in to comment.