diff options
Diffstat (limited to 'tests/frontend')
-rw-r--r-- | tests/frontend/cross_junction_workspace.py | 2 | ||||
-rw-r--r-- | tests/frontend/init.py | 22 | ||||
-rw-r--r-- | tests/frontend/project/sources/fetch_source.py | 2 | ||||
-rw-r--r-- | tests/frontend/workspace.py | 8 |
4 files changed, 17 insertions, 17 deletions
diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py index 81fd43487..14039186c 100644 --- a/tests/frontend/cross_junction_workspace.py +++ b/tests/frontend/cross_junction_workspace.py @@ -79,7 +79,7 @@ def test_list_cross_junction(cli, tmpdir): workspaces = _yaml.node_get(loaded, list, 'workspaces') assert len(workspaces) == 1 assert 'element' in workspaces[0] - assert _yaml.node_get(workspaces[0], str, 'element') == element + assert workspaces[0].get_str('element') == element def test_close_cross_junction(cli, tmpdir): diff --git a/tests/frontend/init.py b/tests/frontend/init.py index 0eac5d528..e9d92be90 100644 --- a/tests/frontend/init.py +++ b/tests/frontend/init.py @@ -19,9 +19,9 @@ def test_defaults(cli, tmpdir): result.assert_success() project_conf = _yaml.load(project_path) - assert _yaml.node_get(project_conf, str, 'name') == 'foo' - assert _yaml.node_get(project_conf, str, 'format-version') == str(BST_FORMAT_VERSION) - assert _yaml.node_get(project_conf, str, 'element-path') == 'elements' + assert project_conf.get_str('name') == 'foo' + assert project_conf.get_str('format-version') == str(BST_FORMAT_VERSION) + assert project_conf.get_str('element-path') == 'elements' def test_all_options(cli, tmpdir): @@ -37,9 +37,9 @@ def test_all_options(cli, tmpdir): result.assert_success() project_conf = _yaml.load(project_path) - assert _yaml.node_get(project_conf, str, 'name') == 'foo' - assert _yaml.node_get(project_conf, str, 'format-version') == str(2) - assert _yaml.node_get(project_conf, str, 'element-path') == 'ponies' + assert project_conf.get_str('name') == 'foo' + assert project_conf.get_str('format-version') == str(2) + assert project_conf.get_str('element-path') == 'ponies' elements_dir = os.path.join(project, 'ponies') assert os.path.isdir(elements_dir) @@ -70,8 +70,8 @@ def test_force_overwrite_project(cli, tmpdir): result.assert_success() project_conf = _yaml.load(project_path) - assert _yaml.node_get(project_conf, str, 'name') == 'foo' - assert _yaml.node_get(project_conf, str, 'format-version') == str(BST_FORMAT_VERSION) + assert project_conf.get_str('name') == 'foo' + assert project_conf.get_str('format-version') == str(BST_FORMAT_VERSION) @pytest.mark.parametrize("project_name", [('Micheal Jackson'), ('one+one')]) @@ -122,6 +122,6 @@ def test_element_path_interactive(cli, tmp_path, monkeypatch, element_path): assert full_element_path.exists() project_conf = _yaml.load(str(project_conf_path)) - assert _yaml.node_get(project_conf, str, 'name') == 'project_name' - assert _yaml.node_get(project_conf, str, 'format-version') == '0' - assert _yaml.node_get(project_conf, str, 'element-path') == element_path + assert project_conf.get_str('name') == 'project_name' + assert project_conf.get_str('format-version') == '0' + assert project_conf.get_str('element-path') == element_path diff --git a/tests/frontend/project/sources/fetch_source.py b/tests/frontend/project/sources/fetch_source.py index 4c265f99b..9a873d1fe 100644 --- a/tests/frontend/project/sources/fetch_source.py +++ b/tests/frontend/project/sources/fetch_source.py @@ -39,7 +39,7 @@ class FetchSource(Source): # Read config to know which URLs to fetch def configure(self, node): self.original_urls = self.node_get_member(node, list, 'urls') - self.output_file = self.node_get_member(node, str, 'output-text') + self.output_file = node.get_str('output-text') self.fetch_succeeds = {} if 'fetch-succeeds' in node: fetch_succeeds_node = node.get_mapping('fetch-succeeds') diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 5267f8e56..7ca06bdd4 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -186,9 +186,9 @@ def test_open_bzr_customize(cli, tmpdir, datafiles): element_config = _yaml.load(os.path.join(project, "elements", element_name)) source_config = _yaml.node_get(element_config, dict, 'sources', [0]) output = subprocess.check_output(["bzr", "info"], cwd=workspace) - stripped_url = _yaml.node_get(source_config, str, 'url').lstrip("file:///") + stripped_url = source_config.get_str('url').lstrip("file:///") expected_output_str = ("checkout of branch: /{}/{}" - .format(stripped_url, _yaml.node_get(source_config, str, 'track'))) + .format(stripped_url, source_config.get_str('track'))) assert expected_output_str in str(output) @@ -613,8 +613,8 @@ def test_list(cli, tmpdir, datafiles): assert len(workspaces) == 1 space = workspaces[0] - assert _yaml.node_get(space, str, 'element') == element_name - assert _yaml.node_get(space, str, 'directory') == workspace + assert space.get_str('element') == element_name + assert space.get_str('directory') == workspace @pytest.mark.datafiles(DATA_DIR) |