Skip to content
  • Georges Racinet's avatar
    WIP comparison tests: generic comparison methods · 243fabd93511
    Georges Racinet authored
    This follows the development patterns we've been using lately:
    a single bunch of request attributes is given to, e.g, the
    `assert_compare` method, which translates it to Git for Gitaly.
    Request translation is fairly simple, taking care of direct
    attributes that are declared to be commit SHAs.
    
    Before comparison, the Mercurial response is also translated to
    Git. This is done with a list of attribute dotted paths, with
    the special convention that a name ending in `[]` represents a
    list-like value on which iteration must happen (see example
    in `tests_with_gitaly/test_commit.py`).
    
    For cases where attributes are not comparable, or more generally
    acknowledged to differ, the `normalizer` callable can be used.
    
    It's not clear this makes tests easier to write, but it probably
    makes them easier to read.
    243fabd93511