@@ -103,16 +103,36 @@ Both drivers require:
103103
104104## Usage Examples
105105
106+ ``` {testsetup} *
107+ from jumpstarter_driver_ridesx.driver import RideSXDriver, RideSXPowerDriver
108+ from jumpstarter_driver_pyserial.driver import PySerial
109+ from jumpstarter.common.utils import serve
110+ import tempfile
111+
112+ _ridesx_temp_dir = tempfile.mkdtemp()
113+ _ridesx_storage = serve(RideSXDriver(storage_dir=_ridesx_temp_dir, children={"serial": PySerial(url="loop://")}))
114+ _ridesx_power = serve(RideSXPowerDriver(children={"serial": PySerial(url="loop://")}))
115+ ridesx_client = _ridesx_storage.__enter__()
116+ ridesx_power_client = _ridesx_power.__enter__()
117+ ```
118+
119+ ``` {testcleanup} *
120+ _ridesx_storage.__exit__(None, None, None)
121+ _ridesx_power.__exit__(None, None, None)
122+ import shutil
123+ shutil.rmtree(_ridesx_temp_dir, ignore_errors=True)
124+ ```
125+
106126### Flash Single Partition
107127
108- ``` {testcode}
109- # Flash a single partition
128+ ``` {code-block} python
129+ # Flash a single partition (paths must exist; flash runs fastboot on the exporter)
110130ridesx_client.flash("/path/to/boot.img", target="boot")
111131```
112132
113133### Flash Multiple Partitions
114134
115- ``` {testcode}
135+ ``` {code-block} python
116136# Flash multiple partitions
117137partitions = {
118138 "boot": "/path/to/boot.img",
@@ -126,7 +146,7 @@ ridesx_client.flash(partitions)
126146
127147The driver automatically handles compressed images (` .gz ` , ` .gzip ` , ` .xz ` ):
128148
129- ``` {testcode}
149+ ``` {code-block} python
130150# Flash compressed images - decompression is automatic
131151ridesx_client.flash("/path/to/boot.img.gz", target="boot")
132152```
0 commit comments