Fix superbolus test & allow APS plugin to be constraint

This commit is contained in:
Milos Kozak 2019-03-13 18:50:37 +01:00
parent bb5cec95ea
commit 826497c9f6
2 changed files with 3 additions and 0 deletions

View file

@ -93,6 +93,8 @@ public abstract class PluginBase {
return state == State.ENABLED && specialEnableCondition();
if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.PUMP && isEnabled(PluginType.PUMP))
return true;
if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.APS && isEnabled(PluginType.APS))
return true;
if (type == PluginType.PROFILE && pluginDescription.mainType == PluginType.PUMP)
return isProfileInterfaceEnabled;
return false;

View file

@ -122,6 +122,7 @@ public class ConstraintsCheckerTest {
@Test
public void isSuperBolusEnabledTest() throws Exception {
OpenAPSSMBPlugin.getPlugin().setPluginEnabled(PluginType.APS, true);
Constraint<Boolean> c = constraintChecker.isSuperBolusEnabled();
Assert.assertEquals(Boolean.FALSE, c.value()); // SMB should limit