Commit Graph

3 Commits

Author SHA1 Message Date
Patrick Steinhardt
b2e53f3692 tests: odb: implement exists_prefix for the fake backend
The fake backend currently implements all reading functions except for
the `exists_prefix` one. Implement it to enable further testing of the
ODB layer.
2017-06-13 11:43:20 +02:00
Patrick Steinhardt
6e010bb126 tests: odb: allow passing fake objects to the fake backend
Right now, the fake backend is quite restrained in the way how it
works: we pass it an OID which it is to return later as well as an error
code we want it to return. While this is sufficient for existing tests,
we can make the fake backend a little bit more generic in order to allow
us testing for additional scenarios.

To do so, we change the backend to not accept an error code and OID
which it is to return for queries, but instead a simple array of OIDs
with their respective blob contents. On each query, the fake backend
simply iterates through this array and returns the first matching
object.
2017-06-12 17:24:53 +02:00
Patrick Steinhardt
2add34d0fb tests: odb: move fake backend into its own file
The fake backend used by the test suite `odb::backend::nonrefreshing` is
useful to have some low-level tests for the ODB layer. As such, we move
the implementation into its own `backend_helpers` module.
2017-06-12 17:24:53 +02:00