def test_requires_stop(self) -> None: point = PointPulseTemplate([('foo', 'v'), ('bar', 0)], [0]) test_sets = [(False, { 'foo': DummyParameter(0, False), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, False) }, { 'foo': DummyCondition(False) }), (False, { 'foo': DummyParameter(0, False), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, False) }, { 'foo': DummyCondition(True) }), (True, { 'foo': DummyParameter(0, True), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, False) }, { 'foo': DummyCondition(False) }), (True, { 'foo': DummyParameter(0, True), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, False) }, { 'foo': DummyCondition(True) }), (True, { 'foo': DummyParameter(0, False), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, True) }, { 'foo': DummyCondition(False) }), (True, { 'foo': DummyParameter(0, False), 'bar': DummyParameter(0, False), 'v': DummyParameter(0, True) }, { 'foo': DummyCondition(True) }), (True, { 'foo': DummyParameter(0, True), 'bar': DummyParameter(0, True), 'v': DummyParameter(0, True) }, { 'foo': DummyCondition(False) }), (True, { 'foo': DummyParameter(0, True), 'bar': DummyParameter(0, True), 'v': DummyParameter(0, True) }, { 'foo': DummyCondition(True) })] for expected_result, parameter_set, condition_set in test_sets: self.assertEqual(expected_result, point.requires_stop(parameter_set, condition_set))
def test_requires_stop_missing_param(self) -> None: table = PointPulseTemplate([('foo', 'v')], [0]) with self.assertRaises(ParameterNotProvidedException): table.requires_stop({'foo': DummyParameter(0, False)}, {})