Skip to content

Commit 4a86656

Browse files
committed
refactor(tests): loadfixture -> load_fixture
1 parent 40d6d56 commit 4a86656

File tree

14 files changed

+69
-69
lines changed

14 files changed

+69
-69
lines changed

tests/fixtures/_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FIXTURE_PATH = pathlib.Path(__file__).parent
44

55

6-
def loadfixture(_file): # return fixture data, relative to __file__
6+
def load_fixture(_file): # return fixture data, relative to __file__
77
return open(FIXTURE_PATH / _file).read()
88

99

tests/fixtures/config/expand2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22

3-
from .._util import loadfixture
3+
from .._util import load_fixture
44

5-
unexpanded_yaml = loadfixture("config/expand2-unexpanded.yaml")
6-
expanded_yaml = loadfixture("config/expand2-expanded.yaml").format(
5+
unexpanded_yaml = load_fixture("config/expand2-unexpanded.yaml")
6+
expanded_yaml = load_fixture("config/expand2-expanded.yaml").format(
77
HOME=os.path.expanduser("~")
88
)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
before = loadfixture("config/shell_command_before_session.yaml")
4-
expected = loadfixture("config/shell_command_before_session-expected.yaml")
3+
before = load_fixture("config/shell_command_before_session.yaml")
4+
expected = load_fixture("config/shell_command_before_session-expected.yaml")

tests/fixtures/config_teamocil/layouts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
teamocil_yaml = loadfixture("config_teamocil/layouts.yaml")
3+
teamocil_yaml = load_fixture("config_teamocil/layouts.yaml")
44

55
teamocil_dict = {
66
"two-windows": {

tests/fixtures/config_teamocil/test1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
teamocil_yaml = loadfixture("config_teamocil/test1.yaml")
3+
teamocil_yaml = load_fixture("config_teamocil/test1.yaml")
44
teamocil_conf = {
55
"windows": [
66
{

tests/fixtures/config_teamocil/test2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
teamocil_yaml = loadfixture("config_teamocil/test2.yaml")
3+
teamocil_yaml = load_fixture("config_teamocil/test2.yaml")
44
teamocil_dict = {
55
"windows": [
66
{

tests/fixtures/config_teamocil/test3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
teamocil_yaml = loadfixture("config_teamocil/test3.yaml")
3+
teamocil_yaml = load_fixture("config_teamocil/test3.yaml")
44

55
teamocil_dict = {
66
"windows": [

tests/fixtures/config_teamocil/test4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
teamocil_yaml = loadfixture("config_teamocil/test4.yaml")
3+
teamocil_yaml = load_fixture("config_teamocil/test4.yaml")
44

55
teamocil_dict = {
66
"windows": [

tests/fixtures/config_tmuxinator/test1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
tmuxinator_yaml = loadfixture("config_tmuxinator/test1.yaml")
3+
tmuxinator_yaml = load_fixture("config_tmuxinator/test1.yaml")
44
tmuxinator_dict = {
55
"windows": [
66
{"editor": {"layout": "main-vertical", "panes": ["vim", "guard"]}},

tests/fixtures/config_tmuxinator/test2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
tmuxinator_yaml = loadfixture("config_tmuxinator/test2.yaml")
3+
tmuxinator_yaml = load_fixture("config_tmuxinator/test2.yaml")
44

55
tmuxinator_dict = {
66
"project_name": "sample",

tests/fixtures/config_tmuxinator/test3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from .._util import loadfixture
1+
from .._util import load_fixture
22

3-
tmuxinator_yaml = loadfixture("config_tmuxinator/test3.yaml")
3+
tmuxinator_yaml = load_fixture("config_tmuxinator/test3.yaml")
44

55
tmuxinator_dict = {
66
"name": "sample",

tests/test_cli.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
)
2929
from tmuxp.workspacebuilder import WorkspaceBuilder
3030

31-
from .fixtures._util import FIXTURE_PATH, loadfixture
31+
from .fixtures._util import FIXTURE_PATH, load_fixture
3232

3333

3434
def test_creates_config_dir_not_exists(tmp_path: pathlib.Path):
@@ -861,7 +861,7 @@ def test_help(cli_args, monkeypatch):
861861
],
862862
)
863863
def test_import_teamocil(cli_args, inputs, tmp_path, monkeypatch):
864-
teamocil_config = loadfixture("config_teamocil/test4.yaml")
864+
teamocil_config = load_fixture("config_teamocil/test4.yaml")
865865

866866
teamocil_path = tmp_path / ".teamocil"
867867
teamocil_path.mkdir()
@@ -900,7 +900,7 @@ def test_import_teamocil(cli_args, inputs, tmp_path, monkeypatch):
900900
],
901901
)
902902
def test_import_tmuxinator(cli_args, inputs, tmp_path, monkeypatch):
903-
tmuxinator_config = loadfixture("config_tmuxinator/test3.yaml")
903+
tmuxinator_config = load_fixture("config_tmuxinator/test3.yaml")
904904

905905
tmuxinator_path = tmp_path / ".tmuxinator"
906906
tmuxinator_path.mkdir()
@@ -1110,7 +1110,7 @@ def test_ls_cli(monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path):
11101110
def test_load_plugins(monkeypatch_plugin_test_packages):
11111111
from tmuxp_test_plugin_bwb.plugin import PluginBeforeWorkspaceBuilder
11121112

1113-
plugins_config = loadfixture("workspacebuilder/plugin_bwb.yaml")
1113+
plugins_config = load_fixture("workspacebuilder/plugin_bwb.yaml")
11141114

11151115
sconfig = kaptan.Kaptan(handler="yaml")
11161116
sconfig = sconfig.import_config(plugins_config).get()
@@ -1193,7 +1193,7 @@ def test_plugin_system_before_script(
11931193

11941194

11951195
def test_reattach_plugins(monkeypatch_plugin_test_packages, server):
1196-
config_plugins = loadfixture("workspacebuilder/plugin_r.yaml")
1196+
config_plugins = load_fixture("workspacebuilder/plugin_r.yaml")
11971197

11981198
sconfig = kaptan.Kaptan(handler="yaml")
11991199
sconfig = sconfig.import_config(config_plugins).get()
@@ -1224,7 +1224,7 @@ def test_load_attached(server, monkeypatch):
12241224

12251225
monkeypatch.setattr("libtmux.session.Session.attach_session", attach_session_mock)
12261226

1227-
yaml_config = loadfixture("workspacebuilder/two_pane.yaml")
1227+
yaml_config = load_fixture("workspacebuilder/two_pane.yaml")
12281228
sconfig = kaptan.Kaptan(handler="yaml")
12291229
sconfig = sconfig.import_config(yaml_config).get()
12301230

@@ -1244,7 +1244,7 @@ def test_load_attached_detached(server, monkeypatch):
12441244

12451245
monkeypatch.setattr("libtmux.session.Session.attach_session", attach_session_mock)
12461246

1247-
yaml_config = loadfixture("workspacebuilder/two_pane.yaml")
1247+
yaml_config = load_fixture("workspacebuilder/two_pane.yaml")
12481248
sconfig = kaptan.Kaptan(handler="yaml")
12491249
sconfig = sconfig.import_config(yaml_config).get()
12501250

@@ -1264,7 +1264,7 @@ def test_load_attached_within_tmux(server, monkeypatch):
12641264

12651265
monkeypatch.setattr("libtmux.session.Session.switch_client", switch_client_mock)
12661266

1267-
yaml_config = loadfixture("workspacebuilder/two_pane.yaml")
1267+
yaml_config = load_fixture("workspacebuilder/two_pane.yaml")
12681268
sconfig = kaptan.Kaptan(handler="yaml")
12691269
sconfig = sconfig.import_config(yaml_config).get()
12701270

@@ -1284,7 +1284,7 @@ def test_load_attached_within_tmux_detached(server, monkeypatch):
12841284

12851285
monkeypatch.setattr("libtmux.session.Session.switch_client", switch_client_mock)
12861286

1287-
yaml_config = loadfixture("workspacebuilder/two_pane.yaml")
1287+
yaml_config = load_fixture("workspacebuilder/two_pane.yaml")
12881288
sconfig = kaptan.Kaptan(handler="yaml")
12891289
sconfig = sconfig.import_config(yaml_config).get()
12901290

@@ -1296,7 +1296,7 @@ def test_load_attached_within_tmux_detached(server, monkeypatch):
12961296

12971297

12981298
def test_load_append_windows_to_current_session(server, monkeypatch):
1299-
yaml_config = loadfixture("workspacebuilder/two_pane.yaml")
1299+
yaml_config = load_fixture("workspacebuilder/two_pane.yaml")
13001300
sconfig = kaptan.Kaptan(handler="yaml")
13011301
sconfig = sconfig.import_config(yaml_config).get()
13021302

0 commit comments

Comments
 (0)