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), PGResult3 = riak_repl_pb_api:get(PidC,Bucket,KeyA,CidA,Options),
% it's ok if the first request fails due to the options, % it's ok if the first request fails due to the options,
% try it again without options to see if it passes % try it again without options to see if it passes
case PGResult3 of RetriableGet = case PGResult3 of
{ok, PGResult3Value} -> {ok, PGResult3Value} ->
?assertEqual(ValueA, riakc_obj:get_value(PGResult3Value)); riakc_obj:get_value(PGResult3Value);
{error, notfound} -> {error, notfound} ->
RetryOptions = [{n_val, 1}], RetryOptions = [{n_val, 1}],
{ok, PGResult4Value} = riak_repl_pb_api:get(PidC,Bucket,KeyA,CidA,RetryOptions), {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 -> UnknownResult ->
%% welp, we might have been expecting a notfound, but we got %% welp, we might have been expecting a notfound, but we got
%% something else. %% something else.
lager:error("Unexpected result: %p", [UnknownResult]), UnknownResult
?assertEqual(fish, chips)
end, end,
?assertEqual(ValueA, RetriableGet),
pass. pass.
%% test 1.2 replication (aka "Default" repl) %% test 1.2 replication (aka "Default" repl)