-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_app_path.py
39 lines (28 loc) · 1.17 KB
/
test_app_path.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "cnheider"
__doc__ = ""
from warg import app_path
_app_name = "MyApp"
_app_author = __author__
props = ("user_data", "user_config", "user_cache", "user_state", "user_log", "site_data", "site_config")
def test_all():
print("-- app dirs (with optional 'version')")
dirs = app_path.AppPath(_app_name, _app_author, app_version="1.0", ensure_existence=False)
for prop in props:
print("%s: %s" % (prop, getattr(dirs, prop)))
def test_no_ver():
print("\n-- app dirs (without optional 'version')")
dirs = app_path.AppPath(_app_name, _app_author, ensure_existence=False)
for prop in props:
print("%s: %s" % (prop, getattr(dirs, prop)))
def test_author():
print("\n-- app dirs (without optional '_app_author')")
dirs = app_path.AppPath(_app_name, ensure_existence=False)
for prop in props:
print("%s: %s" % (prop, getattr(dirs, prop)))
def test_no_author():
print("\n-- app dirs (with disabled '_app_author')")
dirs = app_path.AppPath(_app_name, app_author=False, ensure_existence=False)
for prop in props:
print("%s: %s" % (prop, getattr(dirs, prop)))