11import argparse
22import contextlib
3- import os
43import pathlib
54import typing as t
65
@@ -27,7 +26,7 @@ def test_creates_config_dir_not_exists(tmp_path: pathlib.Path) -> None:
2726 """cli.startup() creates config dir if not exists."""
2827
2928 cli .startup (tmp_path )
30- assert os . path . exists (tmp_path )
29+ assert tmp_path . exists ()
3130
3231
3332@pytest .mark .parametrize (
@@ -56,26 +55,28 @@ def test_resolve_behavior(
5655) -> None :
5756 expect = tmp_path
5857 monkeypatch .chdir (tmp_path )
59- assert pathlib .Path ("../" ).resolve () == pathlib . Path ( os . path . dirname ( expect ))
58+ assert pathlib .Path ("../" ).resolve () == expect . parent
6059 assert pathlib .Path ().resolve () == expect
6160 assert pathlib .Path ("./" ).resolve () == expect
6261 assert pathlib .Path (expect ).resolve () == expect
6362
6463
6564def test_get_tmuxinator_dir (monkeypatch : pytest .MonkeyPatch ) -> None :
66- assert get_tmuxinator_dir () == os . path . expanduser ("~/.tmuxinator/" )
65+ assert get_tmuxinator_dir () == pathlib . Path ("~/.tmuxinator" ). expanduser ( )
6766
6867 monkeypatch .setenv ("HOME" , "/moo" )
69- assert get_tmuxinator_dir () == "/moo/.tmuxinator/"
70- assert get_tmuxinator_dir () == os .path .expanduser ("~/.tmuxinator/" )
68+ assert get_tmuxinator_dir () == pathlib .Path ("/moo/.tmuxinator/" )
69+ assert str (get_tmuxinator_dir ()) == "/moo/.tmuxinator"
70+ assert get_tmuxinator_dir () == pathlib .Path ("~/.tmuxinator/" ).expanduser ()
7171
7272
7373def test_get_teamocil_dir (monkeypatch : pytest .MonkeyPatch ) -> None :
74- assert get_teamocil_dir () == os . path . expanduser ("~/.teamocil/" )
74+ assert get_teamocil_dir () == pathlib . Path ("~/.teamocil/" ). expanduser ( )
7575
7676 monkeypatch .setenv ("HOME" , "/moo" )
77- assert get_teamocil_dir () == "/moo/.teamocil/"
78- assert get_teamocil_dir () == os .path .expanduser ("~/.teamocil/" )
77+ assert get_teamocil_dir () == pathlib .Path ("/moo/.teamocil/" )
78+ assert str (get_teamocil_dir ()) == "/moo/.teamocil"
79+ assert get_teamocil_dir () == pathlib .Path ("~/.teamocil/" ).expanduser ()
7980
8081
8182def test_pass_config_dir_ClickPath (
0 commit comments