Files
carbon-lang/proposals/scripts/proposals_test.py
T
Jon Meow f2d48f1bd0 Move the jekyll sidebar to a python script for consistent generation. (#205)
One implication here is that both proposals/README.md and the website should use basically the same format for their proposal lists. Another subtle change is that the website sidebar was previously sorted by *filename*, and is now sorted by *title*, which seems better because it's something that readers can see.

Enumerating why files change:

- gen_sidebar.py is the centerpiece, with a couple helpful functions for re-use elsewhere
- Delete the old sidebar html includes
- Modify the Makefile to handle gen_sidebar.py reasonably well (let's be honest... I'm not great at Makefiles)
- Move proposal listing out to its own file (proposals.py) for re-use
- Add a few PYTHONPATH things + `__init__.py` files to get modules importing correctly (may be a better way at this, I've hit a wall though).
2020-12-04 08:26:25 -08:00

26 lines
718 B
Python

"""Tests for proposals.py."""
__copyright__ = """
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
import unittest
from proposals.scripts import proposals
class TestProposal(unittest.TestCase):
def test_get_path(self):
proposals_path = proposals.get_path()
p = proposals.get_list(proposals_path)
self.assertEqual(
p[0],
(
"0029 - Linear, rebase, and pull-request GitHub workflow",
"p0029.md",
),
)
self.assertEqual(p[1], ("0029 - Decision", "p0029_decision.md"))