mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
clean up assert for get w/ options
This commit is contained in:
parent
99d716c471
commit
58982f9aa7
@ -244,19 +244,19 @@ test_basic_pg(Mode, SSL) ->
|
||||
PGResult3 = riak_repl_pb_api:get(PidC,Bucket,KeyA,CidA,Options),
|
||||
% it's ok if the first request fails due to the options,
|
||||
% try it again without options to see if it passes
|
||||
case PGResult3 of
|
||||
RetriableGet = case PGResult3 of
|
||||
{ok, PGResult3Value} ->
|
||||
?assertEqual(ValueA, riakc_obj:get_value(PGResult3Value));
|
||||
riakc_obj:get_value(PGResult3Value);
|
||||
{error, notfound} ->
|
||||
RetryOptions = [{n_val, 1}],
|
||||
{ok, PGResult4Value} = riak_repl_pb_api:get(PidC,Bucket,KeyA,CidA,RetryOptions),
|
||||
?assertEqual(ValueA, riakc_obj:get_value(PGResult4Value));
|
||||
riakc_obj:get_value(PGResult4Value);
|
||||
UnknownResult ->
|
||||
%% welp, we might have been expecting a notfound, but we got
|
||||
%% something else.
|
||||
lager:error("Unexpected result: %p", [UnknownResult]),
|
||||
?assertEqual(fish, chips)
|
||||
%% welp, we might have been expecting a notfound, but we got
|
||||
%% something else.
|
||||
UnknownResult
|
||||
end,
|
||||
?assertEqual(ValueA, RetriableGet),
|
||||
pass.
|
||||
|
||||
%% test 1.2 replication (aka "Default" repl)
|
||||
|
Loading…
Reference in New Issue
Block a user