Skip to content

Commit

Permalink
fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
pierky committed Oct 12, 2017
1 parent 23a0625 commit 1e028d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
20 changes: 2 additions & 18 deletions pierky/arouteserver/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@


def get_local_dir(dirname):
local_path = dirname
if os.path.isdir(local_path):
return local_path

pkg_path = pkg_resources.resource_filename("pierky.arouteserver", dirname)
if os.path.isdir(pkg_path):
return pkg_path

raise ResourceNotFoundError(
"Can't find '{}' directory neither at {} nor at {}".format(
dirname, local_path, pkg_path
"Can't find '{}' directory at {}".format(
dirname, pkg_path
)
)

Expand All @@ -42,15 +38,3 @@ def get_templates_dir():

def get_live_test_skeleton_dir():
return get_local_dir("tests/live_tests/skeleton")

def get_config_file(filename):
config_dir = get_config_dir()
path = os.path.join(config_dir, filename)
if os.path.isfile(path):
return path

raise ResourceNotFoundError(
"Can't find '{}' configuration file at {}".format(
filename, config_dir
)
)
2 changes: 1 addition & 1 deletion tests/static/test_cfg_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_050_setup_then_rm_templates(self):

def test_060_setup_rm_templates_then_fix(self):
"""Program config: setup, remove templates then fix it"""
self.test_050_setup_then_rm_templates
self.test_050_setup_then_rm_templates()

self.pr_cfg.setup_templates()
errors = self.pr_cfg.verify_templates()
Expand Down

0 comments on commit 1e028d4

Please sign in to comment.