Skip to content

Commit

Permalink
fixes client test (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Esser50K authored Aug 2, 2021
1 parent e5941e5 commit ffde235
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 4 additions & 3 deletions picameleon/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def stop_stream(self, stream_id: str):
self.output_holders[stream_id].stop()
self.output_holders[stream_id].shutdown()
del self.output_holders[stream_id]
self.current_streams[stream_id].thread.join()
del self.current_streams[stream_id]
del self.current_frames[stream_id]
self.current_streams[stream_id].thread.join()

def __is_receiver(self, stream_id: str):
return self.current_streams[stream_id].port != 0
Expand Down Expand Up @@ -191,6 +189,9 @@ def __fetch_stream(self,
finally:
sock.close()
self.current_streams[stream_id].event.set()
with self.__lock:
del self.current_streams[stream_id]
del self.current_frames[stream_id]

def trigger(self, port=DEFAULT_TRIGGER_SERVER_PORT):
sock = socket.socket()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ def main():
packages=["picameleon", "picameleon.outputs"],
include_package_data=True,
platforms='ALL',
version='0.0.1',
version='0.0.2',
license='LGPLv3',
description='A python client or picameleon',
author='André Esser',
author_email='[email protected]',
url='https://github.com/Esser50K/PiCameleon',
download_url='https://github.com/Esser50K/PiCameleon/archive/refs/tags/picameleon-client-v0.0.1.tar.gz',
download_url='https://github.com/Esser50K/PiCameleon/archive/refs/tags/picameleon-client-v0.0.2.tar.gz',
keywords=['picamera', 'service', 'raspberrypi'],
install_requires=[],
classifiers=[
Expand Down
1 change: 1 addition & 0 deletions test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ docker run -dt --rm --entrypoint /bin/bash \

docker cp tests picameleon_test:/tests
docker cp test_all.py picameleon_test:/test_all.py
docker exec picameleon_test /bin/bash -c 'pip3 install picameleon'
docker exec picameleon_test /bin/bash -c 'cd / && python3 -u test_all.py'

docker stop picameleon_test
5 changes: 1 addition & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import sys
sys.path.append("/picameleon")
sys.path.append("../picameleon")
from client.client import Client
from picameleon import Client
import unittest
from unittest.mock import MagicMock, patch, call
from struct import pack
Expand Down

0 comments on commit ffde235

Please sign in to comment.