This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree 5 files changed +17
-3
lines changed
5 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 7
7
install :
8
8
- ' a() { set -e; }'
9
9
- " z() { E=$?; test $E -eq 0 && return 0; printf \"\\ n\\ 033[1;31mThe command failed with exit code $?.\\ 033[0m\" ; set -e; return $E; }"
10
- - (a; sudo pip2 install nose psutil );z
10
+ - (a; sudo pip2 install nose psutil mock );z
11
11
- ' (a; sudo pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git );z'
12
12
script :
13
13
- (a; sudo python setup.py install );z
14
14
- (a; nosetests tests/web );z
15
+ - (a; nosetests tests/unit );z
15
16
- (a; cd tests; python -um sitl );z
16
17
git :
17
18
depth : 10
Original file line number Diff line number Diff line change @@ -18,11 +18,12 @@ install:
18
18
'@ | out-file -Encoding ascii -FilePath c:\Users\appveyor\pip\pip.ini
19
19
- cmd : ' setlocal & python -m pip install pip wheel -U & endlocal'
20
20
- cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & pip2 wheel numpy & endlocal"
21
- - cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & pip2 install nose numpy psutil & endlocal"
21
+ - cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & pip2 install nose numpy psutil mock & endlocal"
22
22
- cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git & endlocal"
23
23
build_script :
24
24
- cmd : ' setlocal & python setup.py install & endlocal'
25
25
- cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & nosetests tests\\ web & endlocal"
26
+ - cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & nosetests tests\\ unit & endlocal"
26
27
- cmd : " setlocal & SET PATH=%PYTHON%;c:\\ Python27\\ Scripts;%PATH% & cd tests & python -um sitl & endlocal"
27
28
clone_depth : 10
28
29
test : ' off'
Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ dependencies:
9
9
environment : {}
10
10
- nosetests tests/web :
11
11
environment : {}
12
+ - nosetests tests/unit :
13
+ environment : {}
12
14
- cd tests; python -um sitl :
13
15
environment : {}
14
16
pre :
15
- - pip2 install nose psutil :
17
+ - pip2 install nose psutil mock :
16
18
environment : {}
17
19
- ' pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git ' :
18
20
environment : {}
Original file line number Diff line number Diff line change
1
+ import mock
2
+ from mock import MagicMock
3
+ import droneapi
4
+ from droneapi .module .api import APIModule
5
+ from nose .tools import assert_equals
6
+
7
+ def test_mode ():
8
+ api = APIModule (MagicMock ())
9
+ res = api .get_connection ()
10
+ assert_equals (len (res .get_vehicles ()), 1 )
You can’t perform that action at this time.
0 commit comments