Reset filters.json before tests
This commit is contained in:
parent
df0562d6b4
commit
e1fdb90da6
1 changed files with 3 additions and 0 deletions
|
@ -95,6 +95,7 @@ from Db import Db
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def resetSettings(request):
|
def resetSettings(request):
|
||||||
open("%s/sites.json" % config.data_dir, "w").write("{}")
|
open("%s/sites.json" % config.data_dir, "w").write("{}")
|
||||||
|
open("%s/filters.json" % config.data_dir, "w").write("{}")
|
||||||
open("%s/users.json" % config.data_dir, "w").write("""
|
open("%s/users.json" % config.data_dir, "w").write("""
|
||||||
{
|
{
|
||||||
"15E5rhcAUD69WbiYsYARh4YHJ4sLm2JEyc": {
|
"15E5rhcAUD69WbiYsYARh4YHJ4sLm2JEyc": {
|
||||||
|
@ -111,6 +112,7 @@ def resetTempSettings(request):
|
||||||
if not os.path.isdir(data_dir_temp):
|
if not os.path.isdir(data_dir_temp):
|
||||||
os.mkdir(data_dir_temp)
|
os.mkdir(data_dir_temp)
|
||||||
open("%s/sites.json" % data_dir_temp, "w").write("{}")
|
open("%s/sites.json" % data_dir_temp, "w").write("{}")
|
||||||
|
open("%s/filters.json" % data_dir_temp, "w").write("{}")
|
||||||
open("%s/users.json" % data_dir_temp, "w").write("""
|
open("%s/users.json" % data_dir_temp, "w").write("""
|
||||||
{
|
{
|
||||||
"15E5rhcAUD69WbiYsYARh4YHJ4sLm2JEyc": {
|
"15E5rhcAUD69WbiYsYARh4YHJ4sLm2JEyc": {
|
||||||
|
@ -124,6 +126,7 @@ def resetTempSettings(request):
|
||||||
def cleanup():
|
def cleanup():
|
||||||
os.unlink("%s/sites.json" % data_dir_temp)
|
os.unlink("%s/sites.json" % data_dir_temp)
|
||||||
os.unlink("%s/users.json" % data_dir_temp)
|
os.unlink("%s/users.json" % data_dir_temp)
|
||||||
|
os.unlink("%s/filters.json" % data_dir_temp)
|
||||||
request.addfinalizer(cleanup)
|
request.addfinalizer(cleanup)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue