Unittests and integration tests¶
In order to run the tests, you need to install sgframework, for example in development mode (symbolic links to source):
$ sudo make develop
All dependencies, also for the examples must be installed.
Enable the virtual can bus:
$ sudo make vcan
Make sure that Mosquitto MQTT broker is running.
Run the core tests (also on an embedded Linux board, for example a Beaglebone):
$ make test
In order to also test the graphical example apps, use:
$ make test-all
To run individual test files, execute them from the project root directory (for example):
$ python3 tests/test_framework_resource.py
If you would like to run a single test case in a test file, adjust the if __name__ == '__main__':
section of the file.
Test documentation for core framework¶
test_framework_app¶
Tests for the app part of the sgframework.
-
class
tests.test_framework_app.
TestFrameworkApp
(methodName='runTest')[source] -
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testLoop
()[source]
-
testRepr
()[source]
-
-
tests.test_framework_app.
on_testservice_command_availability
(app, messagetype, servicename, signalname, payload)[source]
-
tests.test_framework_app.
on_testservice_state_data
(app, messagetype, servicename, signalname, payload)[source]
test_framework_resource¶
Tests for the resource part of the sgframework.
-
class
tests.test_framework_resource.
TestBaseFramework
(methodName='runTest')[source] -
testRepr
()[source]
-
-
class
tests.test_framework_resource.
TestFrameworkResource
(methodName='runTest')[source] -
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testLoop
()[source]
-
testLoopBeforeStart
()[source]
-
testLoopNoCleanSession
()[source]
-
testLoopQos2
()[source]
-
testLoopThreaded
()[source]
-
testRepr
()[source]
-
testSendCommandBeforeStart
()[source]
-
testSendDataBeforeStart
()[source]
-
testStartTwice
()[source]
-
testStopBeforeStart
()[source]
-
Test documentation for scripts¶
test_canadapter¶
Tests for the canadapter
-
class
tests.test_canadapter.
TestCanAdapter
(methodName='runTest')[source] -
OUTPUT_FILE_CANDUMPER
= 'temporary-candump.txt'
-
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testConstructorJSON
()[source]
-
testConstructorVerbose
()[source]
-
testConstructorVerbose2
()[source]
-
testConstructorWrongArguments
()[source]
-
testConstructorWrongCanInterface
()[source]
-
testHelpText
()[source]
-
testLoopAggregates
()[source]
-
testLoopIndividualsignals
()[source]
-
testLoopThrottleCanFrames
()[source]
-
Test documentation for minimal examples¶
test_minimal_taxisign¶
Tests for the minimal resource example
Test documentation for elaborate examples¶
test_vehiclesimulator¶
Tests for the vehicle simulator
-
class
tests.test_vehiclesimulator.
TestVehicleSimulator
(methodName='runTest')[source] -
OUTPUT_FILE_CANDUMPER
= 'temporary-candump.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testConstructorVerbose
()[source]
-
testConstructorVerboser
()[source]
-
testConstructorWrongArguments
()[source]
-
testConstructorWrongCanInterface
()[source]
-
testHelpText
()[source]
-
testLoop
()[source]
-
-
tests.test_vehiclesimulator.
disable_virtual_can_bus
()[source]
-
tests.test_vehiclesimulator.
enable_virtual_can_bus
()[source]
test_climateapp¶
Tests for the app controlling the climate service.
-
class
tests.test_climateapp.
TestClimateApp
(methodName='runTest')[source] -
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testConstructorCommandLine
()[source]
-
testConstructorGraphical
()[source]
-
testConstructorWrongArguments
()[source]
-
testHelpText
()[source]
-
testLoop
()[source]
-
test_taxisignservice¶
Tests for the taxi sign.
-
class
tests.test_taxisignservice.
TestTaxisignService
(methodName='runTest')[source] -
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testConstructorCommandLine
()[source]
-
testConstructorGraphical
()[source]
-
testConstructorWrongArguments
()[source]
-
testHelpText
()[source]
-
testLoop
()[source]
-
test_taxisignapp¶
Tests for the app controlling the taxi sign.
-
class
tests.test_taxisignapp.
TestTaxisignApp
(methodName='runTest')[source] -
OUTPUT_FILE_SUBSCRIBER
= 'temporary-sub.txt'
-
setUp
()[source]
-
tearDown
()[source]
-
testConstructor
()[source]
-
testConstructorCommandLine
()[source]
-
testConstructorGraphical
()[source]
-
testConstructorWrongArguments
()[source]
-
testHelpText
()[source]
-
testLoop
()[source]
-