Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UW-657 fs makedirs #572

Merged
merged 42 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c1ae271
WIP
maddenp-noaa Aug 10, 2024
9cd667d
Work on tests
maddenp-noaa Aug 10, 2024
5514c1e
Work on tests
maddenp-noaa Aug 10, 2024
8901b79
Work on tests
maddenp-noaa Aug 10, 2024
2b78d89
Work on tests
maddenp-noaa Aug 10, 2024
28472f8
WIP
maddenp-noaa Aug 10, 2024
ed73451
Add stage-dirs.jsonschema
maddenp-noaa Aug 10, 2024
1a5df26
Works
maddenp-noaa Aug 10, 2024
e2d7d6d
WIP
maddenp-noaa Aug 10, 2024
8e52ebb
Update docs
maddenp-noaa Aug 10, 2024
d0da865
Update docs
maddenp-noaa Aug 10, 2024
ffaeab4
WIP
maddenp-noaa Aug 12, 2024
b8d145a
WIP
maddenp-noaa Aug 12, 2024
219960f
WIP
maddenp-noaa Aug 12, 2024
ce2e4d4
WIP
maddenp-noaa Aug 12, 2024
dc7e828
WIP
maddenp-noaa Aug 12, 2024
778a2eb
Revert 'stage-files' to 'files-to-stage'
maddenp-noaa Aug 14, 2024
6e523e4
Reposition test block
maddenp-noaa Aug 14, 2024
b7ea345
Fix doc
maddenp-noaa Aug 14, 2024
e73ac23
Doc update
maddenp-noaa Aug 14, 2024
a2c92b6
Update docs/sections/user_guide/yaml/mkdir.rst
maddenp-noaa Aug 14, 2024
6068ad9
Update docstring
maddenp-noaa Aug 14, 2024
f615100
mkdir -> makedirs
maddenp-noaa Aug 15, 2024
d7c612e
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 16, 2024
9b9c944
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 16, 2024
09c6055
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 16, 2024
ad8a74e
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 18, 2024
ccfc3e5
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 19, 2024
d562142
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 20, 2024
e56c47d
Renames
maddenp-noaa Aug 20, 2024
7297e46
file -> fs
maddenp-noaa Aug 20, 2024
1802f37
WIP
maddenp-noaa Aug 20, 2024
04402ee
Renames
maddenp-noaa Aug 20, 2024
e08b0a7
file -> fs in docs
maddenp-noaa Aug 20, 2024
4e978b3
Work on docs
maddenp-noaa Aug 20, 2024
159709e
Work on docs
maddenp-noaa Aug 20, 2024
8e6bebb
Update mode fs description in CLI
maddenp-noaa Aug 20, 2024
23e37a1
Update docs
maddenp-noaa Aug 20, 2024
81db421
Doc update
maddenp-noaa Aug 20, 2024
dfca65a
Doc update
maddenp-noaa Aug 20, 2024
d7d79fd
Merge branch 'main' into uw-657-file-mkdir
maddenp-noaa Aug 20, 2024
5389215
Update docs/index.rst
maddenp-noaa Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Work on tests
  • Loading branch information
maddenp-noaa committed Aug 10, 2024
commit 2b78d89f387f85734c0b0b3418e568d0b9a30aa0
39 changes: 5 additions & 34 deletions src/uwtools/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,41 +390,12 @@ def test__dispatch_file(action, funcname):
func.assert_called_once_with(args)


def test__dispatch_file_copy(args_dispatch_file):
@mark.parametrize("action", ["copy", "link", "mkdir"])
def test__dispatch_file_action(action, args_dispatch_file):
args = args_dispatch_file
with patch.object(cli.uwtools.api.file, "copy") as copy:
cli._dispatch_file_copy(args)
copy.assert_called_once_with(
target_dir=args["target_dir"],
config=args["config_file"],
cycle=args["cycle"],
leadtime=args["leadtime"],
keys=args["keys"],
dry_run=args["dry_run"],
stdin_ok=args["stdin_ok"],
)


def test__dispatch_file_link(args_dispatch_file):
args = args_dispatch_file
with patch.object(cli.uwtools.api.file, "link") as link:
cli._dispatch_file_link(args)
link.assert_called_once_with(
target_dir=args["target_dir"],
config=args["config_file"],
cycle=args["cycle"],
leadtime=args["leadtime"],
keys=args["keys"],
dry_run=args["dry_run"],
stdin_ok=args["stdin_ok"],
)


def test__dispatch_file_mkdir(args_dispatch_file):
args = args_dispatch_file
with patch.object(cli.uwtools.api.file, "mkdir") as mkdir:
cli._dispatch_file_mkdir(args)
mkdir.assert_called_once_with(
with patch.object(cli.uwtools.api.file, action) as a:
getattr(cli, f"_dispatch_file_{action}")(args)
a.assert_called_once_with(
target_dir=args["target_dir"],
config=args["config_file"],
cycle=args["cycle"],
Expand Down