clean up assert for get w/ options

This commit is contained in:
Dave Parfitt 2013-07-02 12:52:32 -04:00
parent 99d716c471
commit 58982f9aa7

View File

@ -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)