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

pywbem / pywbemtools / 4067 / 5
92%
master: 93%

Build:
Build:
LAST BUILD BRANCH: andy/use-published-click-repl
DEFAULT BRANCH: master
Ran 19 Aug 2020 04:26PM 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 04:16PM UTC coverage: 91.735% (-0.1%) from 91.834%
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.

  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.

  Also, this approach bypasses the type checks for lists with only one item.

  Changed that to return an empty list for empty input sequences, and
  to go through the sort processing also for seqwuences with a single
  item in order to get the type checks.

* 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... (continued)

3119 of 3400 relevant lines covered (91.74%)

0.92 hits per line

Source Files on job 4067.5 (PACKAGE_LEVEL=latest)
  • Tree
  • List 0
  • Changed 17
  • Source Changed 3
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 844
  • Travis Job 4067.5
  • a766b462 on github
  • Prev 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