Skip to content

Commit

Permalink
Combine status and body snapshot asserts
Browse files Browse the repository at this point in the history
For better diagnostics. If the status code is an error, including the response body in the same snapshot can diagnose why.
  • Loading branch information
john-kurkowski committed Jan 10, 2025
1 parent b12fc6e commit 9795b1d
Show file tree
Hide file tree
Showing 10 changed files with 3,258 additions and 3,239 deletions.
38 changes: 21 additions & 17 deletions tests/__snapshots__/test_cli.ambr
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# serializer version: 1
# name: test_help
'''
Usage: music [OPTIONS] COMMAND [ARGS]...
tuple(
'',
None,
'''
Usage: music [OPTIONS] COMMAND [ARGS]...

Tasks for publishing my music.

Options:
--help Show this message and exit.

Commands:
codegen Generate code for this package.
export Export the given FILES to the given DST_DIR directory.
open Show the folder containing the current project.
render Render vocal, instrumental, etc versions of projects.
stat Print statistics for the given audio files or project renders.
tag Encode FILE to .mp3 and tag with artist, etc metadata.
upload Upload PROJECT_DIRS renders.

Tasks for publishing my music.

Options:
--help Show this message and exit.

Commands:
codegen Generate code for this package.
export Export the given FILES to the given DST_DIR directory.
open Show the folder containing the current project.
render Render vocal, instrumental, etc versions of projects.
stat Print statistics for the given audio files or project renders.
tag Encode FILE to .mp3 and tag with artist, etc metadata.
upload Upload PROJECT_DIRS renders.

'''
''',
)
# ---
130 changes: 66 additions & 64 deletions tests/__snapshots__/test_stat.ambr
Original file line number Diff line number Diff line change
@@ -1,76 +1,78 @@
# serializer version: 1
# name: test_main_files
'''
TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav
some : stat
tuple(
'',
None,
'''
TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav
some : stat

TMP_PATH_HERE/path/to/Album Title Here/02 - Song Title Here.wav
some : stat

TMP_PATH_HERE/path/to/Album Title Here/02 - Song Title Here.wav
some : stat

'''
# ---
# name: test_main_files.1
_CallList([
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav',
''',
_CallList([
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav',
),
dict({
'verbose': 0,
}),
),
dict({
'verbose': 0,
}),
),
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Album Title Here/02 - Song Title Here.wav',
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Album Title Here/02 - Song Title Here.wav',
),
dict({
'verbose': 0,
}),
),
dict({
'verbose': 0,
}),
),
])
]),
)
# ---
# name: test_main_no_args
'''
TMP_PATH_HERE/path/to/Song Title Here/Song Title Here.wav
some : stat

TMP_PATH_HERE/path/to/Song Title Here/Song Title Here (A Cappella).wav
some : stat
tuple(
'',
None,
'''
TMP_PATH_HERE/path/to/Song Title Here/Song Title Here.wav
some : stat

TMP_PATH_HERE/path/to/Song Title Here/Song Title Here (A Cappella).wav
some : stat

'''
# ---
# name: test_main_no_args.1
_CallList([
_Call(
'',
tuple(
''',
_CallList([
_Call(
'',
tuple(
),
dict({
}),
),
dict({
}),
),
])
# ---
# name: test_main_no_args.2
_CallList([
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Song Title Here/Song Title Here.wav',
]),
_CallList([
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Song Title Here/Song Title Here.wav',
),
dict({
'verbose': 0,
}),
),
dict({
'verbose': 0,
}),
),
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Song Title Here/Song Title Here (A Cappella).wav',
_Call(
'',
tuple(
'TMP_PATH_HERE/path/to/Song Title Here/Song Title Here (A Cappella).wav',
),
dict({
'verbose': 0,
}),
),
dict({
'verbose': 0,
}),
),
])
]),
)
# ---
54 changes: 28 additions & 26 deletions tests/__snapshots__/test_tag.ambr
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# serializer version: 1
# name: test_main
''
# ---
# name: test_main.1
_CallList([
_Call(
'',
tuple(
list([
'lame',
'--preset',
'standard',
'--ta',
'Bluu',
'--tl',
'Album Title Here',
'--tn',
'01',
'--tt',
'Song Title Here',
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav',
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.mp3',
]),
tuple(
'',
None,
'',
_CallList([
_Call(
'',
tuple(
list([
'lame',
'--preset',
'standard',
'--ta',
'Bluu',
'--tl',
'Album Title Here',
'--tn',
'01',
'--tt',
'Song Title Here',
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.wav',
'TMP_PATH_HERE/path/to/Album Title Here/01 - Song Title Here.mp3',
]),
),
dict({
}),
),
dict({
}),
),
])
]),
)
# ---
Loading

0 comments on commit 9795b1d

Please sign in to comment.