Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for mbb severity and fix error #15

Merged
merged 1 commit into from
Jul 5, 2021
Merged

Add test case for mbb severity and fix error #15

merged 1 commit into from
Jul 5, 2021

Conversation

thomascobb
Copy link
Contributor

Also, when using alarm.MINOR_ALARM instead of "MINOR" I got:

Traceback (most recent call last):
  File "/dls/science/users/tmc43/common/python/pythonIoc/tests/sim_records.py", line 29, in <module>
    t_mbbi = mbbIn('MBBI', 'One', 'Two', ('Three', alarm.MINOR_ALARM), initial_value=2)
  File "/dls/science/users/tmc43/common/python/pythonIoc/softioc/builder.py", line 86, in mbbIn
    return _in_record('mbbi', name, **fields)
  File "/dls/science/users/tmc43/common/python/pythonIoc/softioc/builder.py", line 28, in _in_record
    return getattr(PythonDevice, record)(name, **fields)
  File "/dls/science/users/tmc43/common/python/pythonIoc/softioc/pythonSoftIoc.py", line 105, in __call__
    DTYP = self.dtyp, **fields)
  File "/dls/science/users/tmc43/common/python/pythonIoc/softioc/pythonSoftIoc.py", line 33, in __init__
    record = builder(name, **fields)
  File "/scratch/tmc43/pipenv/pythonIoc-y_I5oBLg/lib/python3.7/site-packages/epicsdbbuilder/recordbase.py", line 129, in __init__
    setattr(self, name, value)
  File "/scratch/tmc43/pipenv/pythonIoc-y_I5oBLg/lib/python3.7/site-packages/epicsdbbuilder/recordbase.py", line 195, in __setattr__
    self.__ValidateField(fieldname, value)
  File "/scratch/tmc43/pipenv/pythonIoc-y_I5oBLg/lib/python3.7/site-packages/epicsdbbuilder/recordbase.py", line 206, in __ValidateField
    self._validate.ValidFieldValue(fieldname, str(value))
  File "/scratch/tmc43/pipenv/pythonIoc-y_I5oBLg/lib/python3.7/site-packages/epicsdbbuilder/dbd.py", line 96, in ValidFieldValue
    'Can\'t write "%s" to field %s: %s' % (value, name, message)
AssertionError: Can't write "1" to field TWSV: Not a valid menu choice

@thomascobb thomascobb requested a review from Araneidae July 2, 2021 14:01
@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #15 (df8e470) into master (3b3c47b) will increase coverage by 0.38%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   81.80%   82.19%   +0.38%     
==========================================
  Files          13       13              
  Lines         797      803       +6     
==========================================
+ Hits          652      660       +8     
+ Misses        145      143       -2     
Impacted Files Coverage Δ
softioc/builder.py 95.69% <100.00%> (+2.15%) ⬆️
softioc/asyncio_dispatcher.py 90.90% <0.00%> (+3.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b3c47b...df8e470. Read the comment docs.

@Araneidae
Copy link
Collaborator

Regarding using alarm.MINOR_ALARM, yes, I'm afraid that's how it works. I think that putting in special hacks to work around this would be a terrible idea! At least we get a pretty straightforward error message...

@thomascobb
Copy link
Contributor Author

Regarding using alarm.MINOR_ALARM, yes, I'm afraid that's how it works. I think that putting in special hacks to work around this would be a terrible idea! At least we get a pretty straightforward error message...

I was wondering if this was new behaviour, as the original docs and your updated docs both mentioned using alarm.MIINOR_ALARM when specifying mbbi/o records...

@thomascobb
Copy link
Contributor Author

@Araneidae can I merge this one and make a 3.0 release? I think everything else is sorted now

@Araneidae
Copy link
Collaborator

Go ahead!

@thomascobb thomascobb merged commit 5825491 into master Jul 5, 2021
@thomascobb thomascobb deleted the alarm branch July 5, 2021 08:35
@thomascobb thomascobb restored the alarm branch July 5, 2021 08:45
@thomascobb thomascobb deleted the alarm branch July 5, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants