Skip to content
Snippets Groups Projects

add support of versioning in mock_storage_client_holding_data

Merged Yannick requested to merge unit_test_mock_storage_versioning_support into master
1 unresolved thread

add support of versioning in mock_storage_client_holding_data

Edited by Yannick

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
88 """
89 If version is None it will return the latest version. To determine the latest version, two cases:
90 * the version field in the record is not set or None => considered as the latest
91 * the version field set and not None => latest = record with the greater version (basic int comparison)
92 """
93
94 latest = None
85 95 for d in data:
86 96 # CAREFUL: id might be optional in the model (not set on write)
87 97 # Also storage seems to have problematic behavior with id ending in ':'
88 98 if id is not None and (id == d.id or id + ":" == d.id):
89 99 if version is None or version == d.version: # Note: version None means latest
90 return d
100 if d.version is None: # no version set in record just return this one
101 return d
102 elif latest is None or d.version > latest.version:
  • Yannick added 1 commit

    added 1 commit

    • ce9dbdf4 - fix typo + rework conditions

    Compare with previous version

  • Yannick added 36 commits

    added 36 commits

    Compare with previous version

  • Yannick marked this merge request as ready

    marked this merge request as ready

  • Alexandre Vincent approved this merge request

    approved this merge request

  • Luc Yriarte approved this merge request

    approved this merge request

  • Yannick mentioned in commit 507e5c57

    mentioned in commit 507e5c57

  • merged

  • changed milestone to %M12 - Release 0.15

  • Please register or sign in to reply
    Loading