|
1 | | -def test_init(rev): |
2 | | - rev.CANSparkMax(0, rev.MotorType.kBrushless) |
| 1 | +import rev |
3 | 2 |
|
4 | 3 |
|
5 | | -def test_get_proxies(rev): |
6 | | - sm = rev.CANSparkMax(0, rev.MotorType.kBrushless) |
7 | | - sm.getEncoder() |
8 | | - sm.getPIDController() |
9 | | - sm.getForwardLimitSwitch(rev.LimitSwitchPolarity.kNormallyOpen) |
| 4 | +def test_rev(): |
| 5 | + pass |
10 | 6 |
|
11 | 7 |
|
12 | | -def test_current_limit(rev, hal_data): |
13 | | - sm = rev.CANSparkMax(1, rev.MotorType.kBrushless) |
| 8 | +# def test_init(rev): |
| 9 | +# rev.CANSparkMax(0, rev.MotorType.kBrushless) |
14 | 10 |
|
15 | | - sm.setSecondaryCurrentLimit(50) |
16 | 11 |
|
17 | | - assert hal_data["CAN"]["sparkmax-1"]["currentChop"] == 50.0 |
18 | | - assert isinstance(hal_data["CAN"]["sparkmax-1"]["currentChop"], float) |
19 | | - assert hal_data["CAN"]["sparkmax-1"]["currentChopCycles"] == 0 |
| 12 | +# def test_get_proxies(rev): |
| 13 | +# sm = rev.CANSparkMax(0, rev.MotorType.kBrushless) |
| 14 | +# sm.getEncoder() |
| 15 | +# sm.getPIDController() |
| 16 | +# sm.getForwardLimitSwitch(rev.LimitSwitchPolarity.kNormallyOpen) |
20 | 17 |
|
21 | | - sm.setSecondaryCurrentLimit(52.5, 5) |
22 | 18 |
|
23 | | - assert hal_data["CAN"]["sparkmax-1"]["currentChop"] == 52.5 |
24 | | - assert hal_data["CAN"]["sparkmax-1"]["currentChopCycles"] == 5 |
| 19 | +# def test_current_limit(rev, hal_data): |
| 20 | +# sm = rev.CANSparkMax(1, rev.MotorType.kBrushless) |
25 | 21 |
|
| 22 | +# sm.setSecondaryCurrentLimit(50) |
26 | 23 |
|
27 | | -def test_faults(rev, hal_data): |
28 | | - sm = rev.CANSparkMax(1, rev.MotorType.kBrushed) |
29 | | - rev_sw = sm.getReverseLimitSwitch(rev.LimitSwitchPolarity.kNormallyOpen) |
30 | | - hal_data["CAN"]["sparkmax-1"]["faults"][rev.FaultID.kHardLimitRev] = False |
31 | | - assert not rev_sw.get() |
| 24 | +# assert hal_data["CAN"]["sparkmax-1"]["currentChop"] == 50.0 |
| 25 | +# assert isinstance(hal_data["CAN"]["sparkmax-1"]["currentChop"], float) |
| 26 | +# assert hal_data["CAN"]["sparkmax-1"]["currentChopCycles"] == 0 |
32 | 27 |
|
| 28 | +# sm.setSecondaryCurrentLimit(52.5, 5) |
33 | 29 |
|
34 | | -def test_frame_period(rev, hal_data): |
35 | | - sm = rev.CANSparkMax(2, rev.MotorType.kBrushed) |
36 | | - sm.setPeriodicFramePeriod(rev.PeriodicFrame.kStatus2, 20) |
37 | | - assert ( |
38 | | - hal_data["CAN"]["sparkmax-2"]["frame_period"][rev.PeriodicFrame.kStatus2] == 20 |
39 | | - ) |
| 30 | +# assert hal_data["CAN"]["sparkmax-1"]["currentChop"] == 52.5 |
| 31 | +# assert hal_data["CAN"]["sparkmax-1"]["currentChopCycles"] == 5 |
40 | 32 |
|
41 | 33 |
|
42 | | -def test_pid_set(rev, hal_data): |
43 | | - sm = rev.CANSparkMax(0, rev.MotorType.kBrushless) |
44 | | - pid = sm.getPIDController() |
45 | | - pid.setOutputRange(-1, 1) |
46 | | - pid.setP(0.005) |
47 | | - pid.setReference(5, rev.ControlType.kPosition) |
| 34 | +# def test_faults(rev, hal_data): |
| 35 | +# sm = rev.CANSparkMax(1, rev.MotorType.kBrushed) |
| 36 | +# rev_sw = sm.getReverseLimitSwitch(rev.LimitSwitchPolarity.kNormallyOpen) |
| 37 | +# hal_data["CAN"]["sparkmax-1"]["faults"][rev.FaultID.kHardLimitRev] = False |
| 38 | +# assert not rev_sw.get() |
| 39 | + |
| 40 | + |
| 41 | +# def test_frame_period(rev, hal_data): |
| 42 | +# sm = rev.CANSparkMax(2, rev.MotorType.kBrushed) |
| 43 | +# sm.setPeriodicFramePeriod(rev.PeriodicFrame.kStatus2, 20) |
| 44 | +# assert ( |
| 45 | +# hal_data["CAN"]["sparkmax-2"]["frame_period"][rev.PeriodicFrame.kStatus2] == 20 |
| 46 | +# ) |
| 47 | + |
| 48 | + |
| 49 | +# def test_pid_set(rev, hal_data): |
| 50 | +# sm = rev.CANSparkMax(0, rev.MotorType.kBrushless) |
| 51 | +# pid = sm.getPIDController() |
| 52 | +# pid.setOutputRange(-1, 1) |
| 53 | +# pid.setP(0.005) |
| 54 | +# pid.setReference(5, rev.ControlType.kPosition) |
0 commit comments