Github user tonysun83 commented on a diff in the pull request: https://github.com/apache/couchdb-couch-replicator/pull/51#discussion_r90393469 --- Diff: src/couch_replicator.erl --- @@ -1035,3 +1012,39 @@ rep_stats(State) -> {doc_write_failures, couch_replicator_stats:doc_write_failures(Stats)}, {checkpointed_source_seq, CommittedSeq} ]. + +-ifdef(TEST). + +-include_lib("eunit/include/eunit.hrl"). + +format_status_test() -> + S = "https://user_foo:top_secret@account_bar1.cloudant.com/database_baz/", + T = "https://user_foo:top_secret@account_bar2.cloudant.com/baz_backup/", + Rep0 = list_to_tuple([rep | record_info(fields, rep)]), + State0 = list_to_tuple([rep_state | record_info(fields, rep_state)]), + Rep = Rep0#rep{source = #httpdb{url = S}, target = #httpdb{url = T}}, + State = State0#rep_state{rep_details = Rep}, + ?assertEqual([{data, [{"State", [ + {rep_details,[ + {source,"https://user_foo:*****@account_bar1.cloudant.com/database_baz/"}, --- End diff -- don't want to be too picky, but in the other tests in the companion PR you had a space for these KV pairs.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---