diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5af5621 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/fake-sys"] + path = tests/fake-sys + url = https://github.com/ddemidov/ev3dev-lang-fake-sys.git diff --git a/tests/api_tests.py b/tests/api_tests.py index 045e35d..6de27e4 100755 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -5,7 +5,7 @@ import ev3dev.ev3 as ev3 -ev3.Device.DEVICE_ROOT_PATH = os.path.join(os.path.dirname(__file__), 'fake_sys_class') +ev3.Device.DEVICE_ROOT_PATH = os.path.join(os.path.dirname(__file__), 'fake-sys') class TestAPI(unittest.TestCase): def test_device(self): diff --git a/tests/fake-sys b/tests/fake-sys new file mode 160000 index 0000000..f7b61c7 --- /dev/null +++ b/tests/fake-sys @@ -0,0 +1 @@ +Subproject commit f7b61c799b246bb5a7bb1fd5bdfa5c17c16ac693 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/address b/tests/fake_sys_class/lego-sensor/sensor0/address deleted file mode 100644 index 0fd7c2f..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/address +++ /dev/null @@ -1 +0,0 @@ -in1 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/bin_data b/tests/fake_sys_class/lego-sensor/sensor0/bin_data deleted file mode 100644 index ee7b8d2..0000000 Binary files a/tests/fake_sys_class/lego-sensor/sensor0/bin_data and /dev/null differ diff --git a/tests/fake_sys_class/lego-sensor/sensor0/bin_data_format b/tests/fake_sys_class/lego-sensor/sensor0/bin_data_format deleted file mode 100644 index 40dc46a..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/bin_data_format +++ /dev/null @@ -1 +0,0 @@ -s8 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/command b/tests/fake_sys_class/lego-sensor/sensor0/command deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/commands b/tests/fake_sys_class/lego-sensor/sensor0/commands deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/decimals b/tests/fake_sys_class/lego-sensor/sensor0/decimals deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/decimals +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/direct b/tests/fake_sys_class/lego-sensor/sensor0/direct deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/driver_name b/tests/fake_sys_class/lego-sensor/sensor0/driver_name deleted file mode 100644 index d6b3e5d..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/driver_name +++ /dev/null @@ -1 +0,0 @@ -lego-ev3-ir diff --git a/tests/fake_sys_class/lego-sensor/sensor0/fw_version b/tests/fake_sys_class/lego-sensor/sensor0/fw_version deleted file mode 100644 index 8b13789..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/fw_version +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/fake_sys_class/lego-sensor/sensor0/mode b/tests/fake_sys_class/lego-sensor/sensor0/mode deleted file mode 100644 index 4e16ad5..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/mode +++ /dev/null @@ -1 +0,0 @@ -IR-PROX diff --git a/tests/fake_sys_class/lego-sensor/sensor0/modes b/tests/fake_sys_class/lego-sensor/sensor0/modes deleted file mode 100644 index 4ead0e7..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/modes +++ /dev/null @@ -1 +0,0 @@ -IR-PROX IR-SEEK IR-REMOTE IR-REM-A IR-S-ALT IR-CAL diff --git a/tests/fake_sys_class/lego-sensor/sensor0/num_values b/tests/fake_sys_class/lego-sensor/sensor0/num_values deleted file mode 100644 index d00491f..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/num_values +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/poll_ms b/tests/fake_sys_class/lego-sensor/sensor0/poll_ms deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/power/autosuspend_delay_ms b/tests/fake_sys_class/lego-sensor/sensor0/power/autosuspend_delay_ms deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/power/control b/tests/fake_sys_class/lego-sensor/sensor0/power/control deleted file mode 100644 index 865faf1..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/power/control +++ /dev/null @@ -1 +0,0 @@ -auto diff --git a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_active_time b/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_active_time deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_active_time +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_status b/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_status deleted file mode 100644 index ad7ccf7..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_status +++ /dev/null @@ -1 +0,0 @@ -unsupported diff --git a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_suspended_time b/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_suspended_time deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/power/runtime_suspended_time +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/uevent b/tests/fake_sys_class/lego-sensor/sensor0/uevent deleted file mode 100644 index 3b0425c..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/uevent +++ /dev/null @@ -1,2 +0,0 @@ -LEGO_DRIVER_NAME=lego-ev3-ir -LEGO_PORT_NAME=in1 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/units b/tests/fake_sys_class/lego-sensor/sensor0/units deleted file mode 100644 index 23cb974..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/units +++ /dev/null @@ -1 +0,0 @@ -pct diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value0 b/tests/fake_sys_class/lego-sensor/sensor0/value0 deleted file mode 100644 index b6a7d89..0000000 --- a/tests/fake_sys_class/lego-sensor/sensor0/value0 +++ /dev/null @@ -1 +0,0 @@ -16 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value1 b/tests/fake_sys_class/lego-sensor/sensor0/value1 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value2 b/tests/fake_sys_class/lego-sensor/sensor0/value2 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value3 b/tests/fake_sys_class/lego-sensor/sensor0/value3 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value4 b/tests/fake_sys_class/lego-sensor/sensor0/value4 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value5 b/tests/fake_sys_class/lego-sensor/sensor0/value5 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value6 b/tests/fake_sys_class/lego-sensor/sensor0/value6 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/lego-sensor/sensor0/value7 b/tests/fake_sys_class/lego-sensor/sensor0/value7 deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/address b/tests/fake_sys_class/tacho-motor/motor0/address deleted file mode 100644 index c4161cd..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/address +++ /dev/null @@ -1 +0,0 @@ -outA diff --git a/tests/fake_sys_class/tacho-motor/motor0/command b/tests/fake_sys_class/tacho-motor/motor0/command deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/commands b/tests/fake_sys_class/tacho-motor/motor0/commands deleted file mode 100644 index 0b28632..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/commands +++ /dev/null @@ -1 +0,0 @@ -run-forever run-to-abs-pos run-to-rel-pos run-timed run-direct stop reset diff --git a/tests/fake_sys_class/tacho-motor/motor0/count_per_rot b/tests/fake_sys_class/tacho-motor/motor0/count_per_rot deleted file mode 100644 index 2921a15..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/count_per_rot +++ /dev/null @@ -1 +0,0 @@ -360 diff --git a/tests/fake_sys_class/tacho-motor/motor0/driver_name b/tests/fake_sys_class/tacho-motor/motor0/driver_name deleted file mode 100644 index e66cdb9..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/driver_name +++ /dev/null @@ -1 +0,0 @@ -lego-ev3-m-motor diff --git a/tests/fake_sys_class/tacho-motor/motor0/duty_cycle b/tests/fake_sys_class/tacho-motor/motor0/duty_cycle deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/duty_cycle +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/duty_cycle_sp b/tests/fake_sys_class/tacho-motor/motor0/duty_cycle_sp deleted file mode 100644 index d81cc07..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/duty_cycle_sp +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/fake_sys_class/tacho-motor/motor0/encoder_polarity b/tests/fake_sys_class/tacho-motor/motor0/encoder_polarity deleted file mode 100644 index 31dcc35..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/encoder_polarity +++ /dev/null @@ -1 +0,0 @@ -normal diff --git a/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Kd b/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Kd deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Ki b/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Ki deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Kp b/tests/fake_sys_class/tacho-motor/motor0/hold_pid/Kp deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/polarity b/tests/fake_sys_class/tacho-motor/motor0/polarity deleted file mode 100644 index 31dcc35..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/polarity +++ /dev/null @@ -1 +0,0 @@ -normal diff --git a/tests/fake_sys_class/tacho-motor/motor0/position b/tests/fake_sys_class/tacho-motor/motor0/position deleted file mode 100644 index d81cc07..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/position +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/fake_sys_class/tacho-motor/motor0/position_sp b/tests/fake_sys_class/tacho-motor/motor0/position_sp deleted file mode 100644 index d81cc07..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/position_sp +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/tests/fake_sys_class/tacho-motor/motor0/power/autosuspend_delay_ms b/tests/fake_sys_class/tacho-motor/motor0/power/autosuspend_delay_ms deleted file mode 100644 index e69de29..0000000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/power/control b/tests/fake_sys_class/tacho-motor/motor0/power/control deleted file mode 100644 index 865faf1..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/power/control +++ /dev/null @@ -1 +0,0 @@ -auto diff --git a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_active_time b/tests/fake_sys_class/tacho-motor/motor0/power/runtime_active_time deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_active_time +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_status b/tests/fake_sys_class/tacho-motor/motor0/power/runtime_status deleted file mode 100644 index ad7ccf7..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_status +++ /dev/null @@ -1 +0,0 @@ -unsupported diff --git a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_suspended_time b/tests/fake_sys_class/tacho-motor/motor0/power/runtime_suspended_time deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/power/runtime_suspended_time +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/ramp_down_sp b/tests/fake_sys_class/tacho-motor/motor0/ramp_down_sp deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/ramp_down_sp +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/ramp_up_sp b/tests/fake_sys_class/tacho-motor/motor0/ramp_up_sp deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/ramp_up_sp +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed b/tests/fake_sys_class/tacho-motor/motor0/speed deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kd b/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kd deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kd +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Ki b/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Ki deleted file mode 100644 index abdfb05..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Ki +++ /dev/null @@ -1 +0,0 @@ -60 diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kp b/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kp deleted file mode 100644 index 83b33d2..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed_pid/Kp +++ /dev/null @@ -1 +0,0 @@ -1000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed_regulation b/tests/fake_sys_class/tacho-motor/motor0/speed_regulation deleted file mode 100644 index cfb931e..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed_regulation +++ /dev/null @@ -1 +0,0 @@ -off diff --git a/tests/fake_sys_class/tacho-motor/motor0/speed_sp b/tests/fake_sys_class/tacho-motor/motor0/speed_sp deleted file mode 100644 index 573541a..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/speed_sp +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/fake_sys_class/tacho-motor/motor0/state b/tests/fake_sys_class/tacho-motor/motor0/state deleted file mode 100644 index a2ae71b..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/state +++ /dev/null @@ -1 +0,0 @@ -running diff --git a/tests/fake_sys_class/tacho-motor/motor0/stop_command b/tests/fake_sys_class/tacho-motor/motor0/stop_command deleted file mode 100644 index b19ca9f..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/stop_command +++ /dev/null @@ -1 +0,0 @@ -coast diff --git a/tests/fake_sys_class/tacho-motor/motor0/stop_commands b/tests/fake_sys_class/tacho-motor/motor0/stop_commands deleted file mode 100644 index d871a01..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/stop_commands +++ /dev/null @@ -1 +0,0 @@ -coast brake hold diff --git a/tests/fake_sys_class/tacho-motor/motor0/time_sp b/tests/fake_sys_class/tacho-motor/motor0/time_sp deleted file mode 100644 index 83b33d2..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/time_sp +++ /dev/null @@ -1 +0,0 @@ -1000 diff --git a/tests/fake_sys_class/tacho-motor/motor0/uevent b/tests/fake_sys_class/tacho-motor/motor0/uevent deleted file mode 100644 index 9325de0..0000000 --- a/tests/fake_sys_class/tacho-motor/motor0/uevent +++ /dev/null @@ -1,2 +0,0 @@ -LEGO_DRIVER_NAME=lego-ev3-m-motor -LEGO_PORT_NAME=outA