summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoan Touzet <wohali@users.noreply.github.com>2018-10-23 10:58:53 -0400
committerGitHub <noreply@github.com>2018-10-23 10:58:53 -0400
commit8de1e1dbdecf37070b84384a250497662615654a (patch)
treeab1c8480e78c56c17406a2fdb1f5841be98e18f1
parent75a0dd40aae30afa7505f8e38e8e6e048ca45038 (diff)
parentd02d6140afa0b2eca42b9d20bf2d15f6058e9be9 (diff)
downloadcouchdb-more-python2-fixes.tar.gz
Merge branch 'master' into more-python2-fixesmore-python2-fixes
-rw-r--r--src/couch/src/couch_db.erl13
-rw-r--r--src/couch/src/couch_doc.erl2
-rw-r--r--src/mango/Makefile2
3 files changed, 9 insertions, 8 deletions
diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl
index 4d76ceedc..57e395179 100644
--- a/src/couch/src/couch_db.erl
+++ b/src/couch/src/couch_db.erl
@@ -56,6 +56,7 @@
is_db/1,
is_system_db/1,
is_clustered/1,
+ is_system_db_name/1,
set_revs_limit/2,
set_purge_infos_limit/2,
@@ -1729,15 +1730,15 @@ validate_dbname_int(DbName, Normalized) when is_binary(DbName) ->
match ->
ok;
nomatch ->
- case is_systemdb(Normalized) of
+ case is_system_db_name(Normalized) of
true -> ok;
false -> {error, {illegal_database_name, DbName}}
end
end.
-is_systemdb(DbName) when is_list(DbName) ->
- is_systemdb(?l2b(DbName));
-is_systemdb(DbName) when is_binary(DbName) ->
+is_system_db_name(DbName) when is_list(DbName) ->
+ is_system_db_name(?l2b(DbName));
+is_system_db_name(DbName) when is_binary(DbName) ->
Normalized = normalize_dbname(DbName),
Suffix = filename:basename(Normalized),
case {filename:dirname(Normalized), lists:member(Suffix, ?SYSTEM_DATABASES)} of
@@ -1860,7 +1861,7 @@ dbname_suffix_test_() ->
[{test_name({Expected, Db}), ?_assertEqual(Expected, dbname_suffix(Db))}
|| {Expected, Db} <- WithExpected].
-is_systemdb_test_() ->
+is_system_db_name_test_() ->
Cases = lists:append([
generate_cases_with_shards("long/co$mplex-/path+/" ++ ?b2l(Db))
|| Db <- ?SYSTEM_DATABASES]
@@ -1869,7 +1870,7 @@ is_systemdb_test_() ->
WithExpected = [{?l2b(filename:basename(filename:rootname(Arg))), Db}
|| {Arg, Db} <- Cases],
[{test_name({Expected, Db}) ++ " in ?SYSTEM_DATABASES",
- ?_assert(is_systemdb(Db))} || {Expected, Db} <- WithExpected].
+ ?_assert(is_system_db_name(Db))} || {Expected, Db} <- WithExpected].
should_pass_validate_dbname(DbName) ->
{test_name(DbName), ?_assertEqual(ok, validate_dbname(DbName))}.
diff --git a/src/couch/src/couch_doc.erl b/src/couch/src/couch_doc.erl
index f960ec5c2..e5ad9e9f1 100644
--- a/src/couch/src/couch_doc.erl
+++ b/src/couch/src/couch_doc.erl
@@ -200,7 +200,7 @@ parse_revs(_) ->
validate_docid(DocId, DbName) ->
case DbName =:= ?l2b(config:get("mem3", "shards_db", "_dbs")) andalso
- lists:member(DocId, ?SYSTEM_DATABASES) of
+ couch_db:is_system_db_name(DocId) of
true ->
ok;
false ->
diff --git a/src/mango/Makefile b/src/mango/Makefile
index 1b2a50452..59f4a29c2 100644
--- a/src/mango/Makefile
+++ b/src/mango/Makefile
@@ -46,7 +46,7 @@ test:
# target: pip-install - Installs requires Python packages
pip-install:
pip install nose requests
- pip install hypothesis
+ pip install hypothesis==3.79.0
.PHONY: venv