1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

Simplified tests structure

This commit is contained in:
Sergey Fursov 2013-12-28 14:40:29 +04:00
parent 3b0328ca1e
commit 017df0ddcf
3 changed files with 86 additions and 101 deletions

View file

@ -27,18 +27,25 @@ import hashlib
import os
import radicale
import tempfile
from tests import AuthSystem
from radicale import config
from radicale.auth import htpasswd
from tests import BaseTest
class TestBaseAuthRequests(AuthSystem):
class TestBaseAuthRequests(BaseTest):
"""
Tests basic requests with auth.
We should setup auth for each type before create Application object
"""
def setup(self):
self.userpass = "dG1wOmJlcG8="
def teardown(self):
config.set("auth", "type", "None")
radicale.auth.is_authenticated = lambda *_: True
def test_root(self):
self.colpath = tempfile.mkdtemp()
htpasswd_file_path = os.path.join(self.colpath, ".htpasswd")