Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ env:
install:
- 'a() { set -e; }'
- "z() { E=$?; test $E -eq 0 && return 0; printf \"\\n\\033[1;31mThe command failed with exit code $?.\\033[0m\"; set -e; return $E; }"
- (a; sudo pip2 install nose psutil );z
- (a; sudo pip2 install nose psutil mock );z
- '(a; sudo pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git );z'
script:
- (a; sudo python setup.py install );z
- (a; nosetests tests/web );z
- (a; nosetests tests/unit );z
- (a; cd tests; python -um sitl );z
git:
depth: 10
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ install:
'@ | out-file -Encoding ascii -FilePath c:\Users\appveyor\pip\pip.ini
- cmd: 'setlocal & python -m pip install pip wheel -U & endlocal'
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 wheel numpy & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install nose numpy psutil & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install nose numpy psutil mock & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git & endlocal"
build_script:
- cmd: 'setlocal & python setup.py install & endlocal'
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\web & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\unit & endlocal"
- cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & cd tests & python -um sitl & endlocal"
clone_depth: 10
test: 'off'
Expand Down
4 changes: 3 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ dependencies:
environment: {}
- nosetests tests/web:
environment: {}
- nosetests tests/unit:
environment: {}
- cd tests; python -um sitl:
environment: {}
pre:
- pip2 install nose psutil:
- pip2 install nose psutil mock:
environment: {}
- 'pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git':
environment: {}
Expand Down
Empty file added tests/unit/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions tests/unit/test_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import mock
from mock import MagicMock
import droneapi
from droneapi.module.api import APIModule
from nose.tools import assert_equals

def test_mode():
api = APIModule(MagicMock())
res = api.get_connection()
assert_equals(len(res.get_vehicles()), 1)