From 58982f9aa77b33562f232dae645ef68b680105c4 Mon Sep 17 00:00:00 2001 From: Dave Parfitt Date: Tue, 2 Jul 2013 12:52:32 -0400 Subject: [PATCH] clean up assert for get w/ options --- tests/replication2_pg.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/replication2_pg.erl b/tests/replication2_pg.erl index b8e1bcc2..6c1d8798 100644 --- a/tests/replication2_pg.erl +++ b/tests/replication2_pg.erl @@ -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)