diff --git a/buzzmobile/launch/simulation_test.launch b/buzzmobile/launch/simulation_test.launch new file mode 100644 index 0000000..5a7b752 --- /dev/null +++ b/buzzmobile/launch/simulation_test.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buzzmobile/sense/maps_querier/maps_querier.py b/buzzmobile/sense/maps_querier/maps_querier.py index b8bfc0e..3434464 100755 --- a/buzzmobile/sense/maps_querier/maps_querier.py +++ b/buzzmobile/sense/maps_querier/maps_querier.py @@ -11,7 +11,10 @@ import googlemaps import rospy -import googlemapskey as gmpskey +try: + import googlemapskey as gmpskey +except ImportError as e: + pass from datetime import datetime from sensor_msgs.msg import NavSatFix diff --git a/buzzmobile/setup.py b/buzzmobile/setup.py index bf37210..ea0a139 100644 --- a/buzzmobile/setup.py +++ b/buzzmobile/setup.py @@ -4,9 +4,15 @@ # for downloading the packages needed for this project. from setuptools import setup +TEST_REQUIRES = [ + 'pytest==3.0.3', + 'netifaces==0.10.5', + 'pyrostest>=0.1.2', + ] + setup( name='buzzmobile', - version='0.3', + version='0.3.1', url='https://github.com/gtagency/buzzmobile', author='gtagency', license='MIT', @@ -18,12 +24,9 @@ 'numpy==1.11.2', 'polyline==1.3.1', 'pylint', - 'pytest==3.0.3', 'pyyaml==3.12', 'rospkg==1.0.41', 'ds4drv', # requires apt-get install python-dev 'empy==3.3.2', # required to make catkin_make work - 'netifaces==0.10.5', # required for testing - 'pyrostest>=0.1.2', # required for testing - ], + ] + TEST_REQUIRES, ) diff --git a/buzzmobile/tests/simulation/test_gazebo_connection.py b/buzzmobile/tests/simulation/test_gazebo_connection.py index 69a7e19..b0e348c 100644 --- a/buzzmobile/tests/simulation/test_gazebo_connection.py +++ b/buzzmobile/tests/simulation/test_gazebo_connection.py @@ -1,17 +1,21 @@ -from pyrostest import RosTest, with_launch_file -from rosgraph_msgs.msg import Clock +"""Simple simulation test to connect to Gazebo.""" + import time +from rosgraph_msgs.msg import Clock + +from pyrostest import RosTest, with_launch_file + class TestGazeboConnection(RosTest): """Tests for simulation testing infrastructure.""" - @with_launch_file('buzzmobile', 'simulation.launch') + @with_launch_file('buzzmobile', 'simulation_test.launch') def test_clock_runs(self): """Test that simulation.launch correctly launches gazebo""" with self.check_topic('/clock', Clock) as ct: assert(ct.message) - print(ct.message) - time.sleep(30) + + time.sleep(20) + with self.check_topic('/clock', Clock, 20) as ct1: - print(ct1.message) assert(ct1.message) diff --git a/ci_scripts/simulation b/ci_scripts/simulation index 97b8f55..2be2dea 100755 --- a/ci_scripts/simulation +++ b/ci_scripts/simulation @@ -14,5 +14,5 @@ source ~/catkin_ws/devel/setup.bash cd ~/catkin_ws/src/buzzmobile/buzzmobile # Run unit tests -pytest tests/simulation +python -m pytest tests/simulation diff --git a/ci_scripts/unittest b/ci_scripts/unittest index 1fdc6cc..29d3b81 100755 --- a/ci_scripts/unittest +++ b/ci_scripts/unittest @@ -14,5 +14,5 @@ source ~/catkin_ws/devel/setup.bash cd ~/catkin_ws/src/buzzmobile/buzzmobile # Run unit tests -pytest tests/unit +python -m pytest tests/unit diff --git a/ci_scripts/update_deps b/ci_scripts/update_deps index 9d03cd8..672eb37 100755 --- a/ci_scripts/update_deps +++ b/ci_scripts/update_deps @@ -12,4 +12,4 @@ cd ~/catkin_ws/src rosdep install -y --from-paths ./buzzmobile/buzzmobile --ignore-src --rosdistro=indigo cd ~/catkin_ws/src/buzzmobile -pip install -e buzzmobile +python -m pip install -e buzzmobile