davisp commented on a change in pull request #2666: soft-deletion for database
URL: https://github.com/apache/couchdb/pull/2666#discussion_r400292224
 
 

 ##########
 File path: src/fabric/test/fabric2_db_crud_tests.erl
 ##########
 @@ -139,6 +146,44 @@ recreate_db(_) ->
     ?assertError(database_does_not_exist, fabric2_db:open(DbName, BadOpts)).
 
 
+undelete_db(_) ->
+    DbName = ?tempdb(),
+    ?assertError(database_does_not_exist, fabric2_db:delete(DbName, [])),
+
+    ?assertMatch({ok, _}, fabric2_db:create(DbName, [])),
+    ?assertEqual(true, ets:member(fabric2_server, DbName)),
+
+    ok = config:set("couchdb", "enable_database_recovery", "true", false),
+    ?assertEqual(ok, fabric2_db:delete(DbName, [])),
+    ok = config:delete("couchdb", "enable_database_recovery", false),
+    ?assertEqual(false, ets:member(fabric2_server, DbName)),
+
+    {ok, [{Timestamp, _Info}]} = fabric2_db:deleted_dbs_info(DbName, []),
 
 Review comment:
   For both undelete and delete_deleted we should add tests that assert the 
not_found error if we give it a bad dbname as well as a valid dbname but 
invalid timestamp.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to