generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_dir_traversal: Make use of ExpectedTraverseStep self-documenting
Each DirectoryTraversalVector encapsulate a test case for DirectoryTraversal, and contains a list of steps that we expect DirectoryTraversal to perform for that test case, aka. an ExpectedTraverseStep. These were initialized by passing four positional arguments to the constructor (most of which are lists in their own right). The result was that it was hard to read an ExpectedTraverseStep initialization and immediate see what information was expected at this traversal step (without constantly cross-referencing with the ExpectedTraverseStep class definition). Instead, make all ExpectedTraverseStep members (except the mandatory .dir) optional (defaulting to empty lists), and use _named_ arguments when intializing them. This makes reading the test cases more straightforward: Instead of ExpectedTraverseStep("a/b/c", ["d"], [], [456, 123]) (meaning that we expect the traversal of "a/b/c" to list a single subdir "d", no filenames, and passing [456, 123] as the attached data) we now get ExpectedTraverseStep("a/b/c", subdirs=["d"], attached=[456, 123])
- Loading branch information
Showing
1 changed file
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters