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

Improve test coverage #514

Open
4 of 23 tasks
erlend-aasland opened this issue Jul 10, 2024 · 0 comments
Open
4 of 23 tasks

Improve test coverage #514

erlend-aasland opened this issue Jul 10, 2024 · 0 comments

Comments

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Jul 10, 2024

I'd like to raise the test suite cover more of the code base, as a part of the preparations for #358.

Currently, coverage.py reports 73% code coverage when run locally:

Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
canopen/__init__.py                        12      2    83%
canopen/_version.py                        11      2    82%
canopen/emcy.py                            71     19    73%
canopen/lss.py                            181    106    41%
canopen/network.py                        165     21    87%
canopen/nmt.py                            133      2    98%
canopen/node/__init__.py                    2      0   100%
canopen/node/base.py                        9      0   100%
canopen/node/local.py                      81     10    88%
canopen/node/remote.py                     81     37    54%
canopen/objectdictionary/__init__.py      306     37    88%
canopen/objectdictionary/datatypes.py      82      8    90%
canopen/objectdictionary/eds.py           349     38    89%
canopen/objectdictionary/epf.py            81     81     0%
canopen/pdo/__init__.py                    36      8    78%
canopen/pdo/base.py                       374    108    71%
canopen/profiles/__init__.py                0      0   100%
canopen/profiles/p402.py                  277    176    36%
canopen/sdo/__init__.py                     5      0   100%
canopen/sdo/base.py                        93     20    78%
canopen/sdo/client.py                     461     92    80%
canopen/sdo/constants.py                   27      0   100%
canopen/sdo/exceptions.py                  14      5    64%
canopen/sdo/server.py                     127      9    93%
canopen/sync.py                            19      7    63%
canopen/timestamp.py                       15      0   100%
canopen/utils.py                           13      1    92%
canopen/variable.py                        98     42    57%
-----------------------------------------------------------
TOTAL                                    3123    831    73%

73% is very promising; getting up to 80% is the next milestone.

In #504, I raised the coverage of canopen/nmt.py to 98%. I'm going to continue with canopen/network.py (anticipate PR in a day or two). Feel free to join!

I'll update this list as progress is made:

  • canopen/emcy.py: WIP
  • canopen/lss.py
  • canopen/network.py:
    - Tests: improve coverage of Network #515
    - Tests: improve coverage of NodeScanner #517
  • canopen/nmt.py: Add tests for NMT base and NMT master #504
  • canopen/node/base.py
  • canopen/node/local.py
  • canopen/node/remote.py
  • canopen/objectdictionary/__init__.py
  • canopen/objectdictionary/datatypes.py
  • canopen/objectdictionary/eds.py
  • canopen/objectdictionary/epf.py
  • canopen/pdo/__init__.py
  • canopen/pdo/base.py
  • canopen/profiles/p402.py
  • canopen/sdo/base.py
  • canopen/sdo/client.py
  • canopen/sdo/constants.py
  • canopen/sdo/exceptions.py
  • canopen/sdo/server.py
  • canopen/sync.py: WIP
  • canopen/timestamp.py
  • canopen/utils.py
  • canopen/variable.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants