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

pywbem / pywbemtools / 4061
92%
master: 93%

Build:
Build:
LAST BUILD BRANCH: andy/use-published-click-repl
DEFAULT BRANCH: master
Ran 19 Aug 2020 07:53AM UTC
Jobs 3
Files 21
Run time 3min
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

pending completion
4061

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>

3009 of 3274 relevant lines covered (91.91%)

2.75 hits per line

Jobs
ID Job ID Ran Files Coverage
2 4061.2 (PACKAGE_LEVEL=latest) 19 Aug 2020 07:54AM UTC 0
91.76
Travis Job 4061.2
3 4061.3 (PACKAGE_LEVEL=latest) 19 Aug 2020 07:56AM UTC 0
91.73
Travis Job 4061.3
5 4061.5 (PACKAGE_LEVEL=latest) 19 Aug 2020 07:53AM UTC 0
91.82
Travis Job 4061.5
Source Files on build 4061
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4061
  • cc816852 on github
  • Next Build on andy/pytest (#4063)
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