mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
Test website metadata
Summary: New test that notes and tutorials are listed in the website metadata, so that they will be included in the website build. Reviewed By: nikhilaravi Differential Revision: D30223799 fbshipit-source-id: 2dca9730b54e68da2fd430a7b47cb7e18814d518
This commit is contained in:
parent
64faedfd57
commit
e5c58a8a8b
@ -74,3 +74,35 @@ class TestBuild(unittest.TestCase):
|
||||
for tutorial in tutorials:
|
||||
with open(tutorial) as f:
|
||||
json.load(f)
|
||||
|
||||
@unittest.skipIf(in_conda_build or in_re_worker, "In conda build, or RE worker")
|
||||
def test_enumerated_ipynbs(self):
|
||||
# Check that the tutorials are all referenced in tutorials.json.
|
||||
root_dir = get_pytorch3d_dir()
|
||||
tutorials_dir = root_dir / "docs" / "tutorials"
|
||||
tutorials_on_disk = sorted(i.stem for i in tutorials_dir.glob("*.ipynb"))
|
||||
|
||||
json_file = root_dir / "website" / "tutorials.json"
|
||||
with open(json_file) as f:
|
||||
cfg_dict = json.load(f)
|
||||
listed_in_json = []
|
||||
for section in cfg_dict.values():
|
||||
listed_in_json.extend(item["id"] for item in section)
|
||||
|
||||
self.assertListEqual(sorted(listed_in_json), tutorials_on_disk)
|
||||
|
||||
@unittest.skipIf(in_conda_build or in_re_worker, "In conda build, or RE worker")
|
||||
def test_enumerated_notes(self):
|
||||
# Check that the notes are all referenced in sidebars.json.
|
||||
root_dir = get_pytorch3d_dir()
|
||||
notes_dir = root_dir / "docs" / "notes"
|
||||
notes_on_disk = sorted(i.stem for i in notes_dir.glob("*.md"))
|
||||
|
||||
json_file = root_dir / "website" / "sidebars.json"
|
||||
with open(json_file) as f:
|
||||
cfg_dict = json.load(f)
|
||||
listed_in_json = []
|
||||
for section in cfg_dict["docs"].values():
|
||||
listed_in_json.extend(section)
|
||||
|
||||
self.assertListEqual(sorted(listed_in_json), notes_on_disk)
|
||||
|
Loading…
x
Reference in New Issue
Block a user