Skip to content

Commit

Permalink
feat: create smk_base() python function
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed May 16, 2024
1 parent e89af63 commit 27bf691
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Empty file added src/charlie/__init__.py
Empty file.
Binary file added src/charlie/__pycache__/util.cpython-312.pyc
Binary file not shown.
8 changes: 8 additions & 0 deletions src/charlie/util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os


def smk_base(rel_path):
basedir = os.path.split(
os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]
)[0]
return os.path.join(basedir, rel_path)
12 changes: 12 additions & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import sys

SCRIPT_DIR = os.path.join(
os.path.split(os.path.dirname(os.path.abspath(__file__)))[0], "src", "charlie"
)
sys.path.append(SCRIPT_DIR)
from util import smk_base


def test_smk_base():
assert smk_base("").endswith("charlie/")

0 comments on commit 27bf691

Please sign in to comment.