use aurweb_test for default mysql dev database

This also updates `test/README.md` to be a bit more specific
and precise with our current state of testing.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-20 07:03:46 -07:00
parent 55c0637b98
commit 8abb096d7b
4 changed files with 149 additions and 27 deletions

View file

@ -119,9 +119,20 @@ def test_sqlalchemy_mysql_port_url():
aurweb.config.rehash()
def test_sqlalchemy_mysql_socket_url():
tmpctx, tmp = make_temp_config("conf/config",
(r"[;]?port = 3306", ";port = 3306"))
with tmpctx:
with mock.patch.dict(os.environ, {"AUR_CONFIG": tmp}):
aurweb.config.rehash()
assert db.get_sqlalchemy_url()
aurweb.config.rehash()
def test_sqlalchemy_unknown_backend():
tmpctx, tmp = make_temp_config("conf/config",
(r"backend = mysql", "backend = blah"))
(r"backend = .+", "backend = blah"))
with tmpctx:
with mock.patch.dict(os.environ, {"AUR_CONFIG": tmp}):
@ -156,7 +167,7 @@ def test_connection_class_sqlite_without_fail():
def test_connection_class_unsupported_backend():
tmpctx, tmp = make_temp_config("conf/config",
(r"backend = mysql", "backend = blah"))
(r"backend = .+", "backend = blah"))
with tmpctx:
with mock.patch.dict(os.environ, {"AUR_CONFIG": tmp}):