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

Support nested dictionaries in assert_match_dir #47

Closed
joseph-roitman opened this issue Dec 2, 2021 Discussed in #46 · 0 comments · Fixed by #48
Closed

Support nested dictionaries in assert_match_dir #47

joseph-roitman opened this issue Dec 2, 2021 Discussed in #46 · 0 comments · Fixed by #48
Assignees
Labels
enhancement New feature or request

Comments

@joseph-roitman
Copy link
Owner

snapshot.assert_match_dir should support snapshotting nested dictionaries as a nested directory structure.

For example

snapshot.assert_match_dir({
    'file1.txt': 'file1_contents',
    'sub_directory': {
        'file2.txt': 'file2_contents',
    }
}, 'snapshot-name')

will create a directory named snapshot-name containing file1.txt and sub_directory. sub_directory will contain file2.txt.

Discussed in #46

Originally posted by alfechner November 25, 2021
Hi,

we've got a tool which generates a bunch of files in a nested directory structure. We test the tool by snapshotting the entire directory and save it in exactly the same structure for comparison. Would you be interested in a PR to incorporate this peace of functionality?

Cheers,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant