• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pywbem / pywbemtools / 4061 / 2
92%
master: 93%

Build:
Build:
LAST BUILD BRANCH: andy/use-published-click-repl
DEFAULT BRANCH: master
Ran 19 Aug 2020 07:54AM UTC
Files 21
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Aug 2020 07:43AM UTC coverage: 91.761%. First build
PACKAGE_LEVEL=latest

push

travis-ci

andy-maier
Improved sort_cimobjects() and converted its tests to pytest

Details:

* Converted the unit tests for sort_cimobjects() from unittest to pytest,
  using parametrization. There is now a single test function for all
  object types.

* Added some test cases for sort_cimobjects(), including test cases for
  invalid input types.

* sort_cimobjects() returned the input list if it contained less than
  2 items. That is correct from a sorting perspectivem, but does not meet
  the promise from its documentation to return a *new* list.

  Changed that to always return a new list.

  In fact, there was one testcase that verified the prior behavior by
  appending an object to the input list and checking that the output list was
  also appended. Removed that testcase.

* sort_cimobjects() used a dictionary for sorting in some cases. That
  prevented providing input objects that have equal sort keys, and reduced
  them to a single object in the result.

  Since providing objects with equal sort keys is valid and not excluded in
  the documentation, this was improved to always use sorted() with an
  appropriate key. sorted() invokes the key function on each item only once,
  so for expensive key functions this is not worse as before.

  Added testcases to verify that objects with equal keys now work.

* Changed the exception that is raised when a tuple does not contain
  the required CIMClassName, CIMClass items from AssertionError to
  TypeError, for consistency with the other TypeError that is raised.

* Changed the exception that is raised when a CIMInstance object does
  not have its path set, from AttributeError to ValueError.

  Added testcase for that.

* Updated the docstring of sort_cimobjects() to describe the sorting for
  each object type more precisely.

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>

3007 of 3277 relevant lines covered (91.76%)

0.92 hits per line

Source Files on job 4061.2 (PACKAGE_LEVEL=latest)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 838
  • Travis Job 4061.2
  • cc816852 on github
  • Next Job for PACKAGE_LEVEL=latest on andy/pytest (#4063.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc