feat: move project from poetry to pdm, rewrite from scratch and add
basic `notebooks`, `edit` and `show` commands
This commit is contained in:
parent
d9eb99b72e
commit
d3ad87211e
35 changed files with 1309 additions and 1434 deletions
|
|
@ -1,33 +0,0 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from halig.utils import resolve_path
|
||||
|
||||
|
||||
def test_resolve_absolute_path():
|
||||
path = Path("/foo/bar/baz")
|
||||
assert resolve_path(path) == path
|
||||
|
||||
|
||||
def test_resolve_user_path():
|
||||
path = Path("~/foo/bar/baz")
|
||||
assert resolve_path(path) == path.expanduser()
|
||||
|
||||
|
||||
def test_resolve_path_with_envvars():
|
||||
os.environ["FOO"] = "foo"
|
||||
os.environ["BAR"] = "bar"
|
||||
path = Path("/${FOO}/${BAR}")
|
||||
assert resolve_path(path) == Path("/foo/bar")
|
||||
|
||||
|
||||
def test_resolve_relative_path():
|
||||
path = Path("foo/bar/baz")
|
||||
assert resolve_path(path) == path.resolve()
|
||||
|
||||
|
||||
def test_resolve_path_all():
|
||||
os.environ["FOO"] = "foo"
|
||||
os.environ["BAR"] = "bar"
|
||||
path = Path("foo/bar/$FOO/../$BAR")
|
||||
assert resolve_path(path) == Path(os.path.expandvars(path)).resolve().expanduser()
|
||||
Loading…
Add table
Add a link
Reference in a new issue