Skip to content

Conversation

@andy-maier
Copy link
Member

@andy-maier andy-maier commented Jan 20, 2026

For details, see the commit message.

TODOs:

  • Complete the User methods/properties
  • Complete the BaseResource methods/properties

@andy-maier andy-maier self-assigned this Jan 20, 2026
@andy-maier andy-maier added this to the 1.26.0 milestone Jan 20, 2026
@coveralls
Copy link
Collaborator

coveralls commented Jan 20, 2026

Coverage Status

coverage: 80.072% (+0.09%) from 79.978%
when pulling 8c97d4f on andy/ft-rework
into d9af6b6 on master.

Details:

* Redesigned the JSON schema for the YAML test files:

  - Added support for defining setup resources at the test file level
    and at the testcase level by adding a new property 'setup'. That
    required the list of testcases to be moved under a top-level
    property 'testcases'. The setup objects are stored in a dictionary
    and can be looked up by URI.

  - Moved the definition of a HMC session from a top-level hmc_session
    property in each testcase to become definable at the test file level
    and at the testcase level, within the new 'setup' property.

  - Defined a schema definition 'value' that represents a Python
    value for method parameters, method return values, or property
    values. That fixed the issue that previously, zhmcclient
    resource and manager objects could only be represented as single
    objects but not as items in a list or dict. Also, zhmcclient
    resource and manager objects are now referenced via URI lookup
    in the dictionary resulting from the setup resources.

  - Changed the way the target object of the test is specified, to
    also use the same approach as for 'value', except that it must be
    either a resource or manager object.

  - Changed the way method parameter values and method return values
    are specified in the testcase YAML, to use the 'value' definition.

* Adjusted the test code in conftest.py to the new test file structure.

* In conftest.py, introduced a class TestcaseData in order to
  isolate the data properties pytest does not care about from other
  properties pytest does care about. Before that, it happened that
  a test property happened to use the name of a property known by
  pytest.

* In conftest.py, fixed the issue that requests_mock records only
  the last HTTP request/response pair, by maintaning our own
  list of requests. Apparently, that limitation in requests_mock
  is intentional to keep it simple. The request_mock pytest fixture
  solves that issue, but we cannot use that fixture because we do
  not have pytest test functions.

* In conftest.py, fixed the issue that the zhmcclient result was
  compared with == which lead to comparison failures for different
  but equal objects, and for zhmcclient.BaseResource objects due to
  their timestamp property, and for immutabledict objects returned
  by some properties. This was fixed by adding an assert_result()
  method that performs these comparisons more thoughtfully.

* Adjusted the existing test_user.yaml test file to the new schema,
  and added testcases for the remaining methods and properties
  of zhmcclient.User, except for inherited ones.

* Added a new test file test_resource.yaml and defined testcases
  for any methods and properties inherited into resource classes.

Signed-off-by: Andreas Maier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants