-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved test data to a single directory shared by all modules.
Added a new library for accessing the test data that can be reused from all tests that need it.
- Loading branch information
Showing
51 changed files
with
110 additions
and
81 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2024 Google LLC. All Rights Reserved. | ||
# | ||
# Use of this source code is governed by an MIT-style license that can be found | ||
# in the LICENSE file or at https://opensource.org/licenses/MIT. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2024 Google LLC. All Rights Reserved. | ||
# | ||
# Use of this source code is governed by an MIT-style license that can be found | ||
# in the LICENSE file or at https://opensource.org/licenses/MIT. | ||
|
||
|
||
"""Provides easy access to the test data in JSON format.""" | ||
|
||
from importlib import resources | ||
import json as json_lib | ||
|
||
# Provides easy access to files under `./testdata`. See `_json()` below for | ||
# example use. | ||
_TESTDATA = resources.files(__package__) | ||
|
||
|
||
def json(path: str): | ||
"""Parses a JSON file at `path` and returns it as a dict/list structure. | ||
Args: | ||
path: The path of the JSON file, relative to the package of this module. | ||
Returns: | ||
The JSON data structure. | ||
""" | ||
return json_lib.loads(_TESTDATA.joinpath(path).read_bytes()) |
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