Allow Admin Widget Integration through ReviewBoard Extensions
Review Request #6573 — Created Nov. 9, 2014 and submitted
Information | |
---|---|
justy777 | |
Review Board | |
master | |
6597 | |
dc89704... | |
Reviewers | |
reviewboard, students | |
There's now a AdminWidgetHook that extensions can use to register administartion widgets. This handles registering, and unregistering Admin widgets.
Unit tests have been written to make sure the AdminWidgetHook properly registers and unregisters widgets. A third unit test checks that the Widget subclass being registered ends up in primary_widgets list, when primary is set to True in the hook initalization.
Description | From | Last Updated |
---|---|---|
This test should verify that the widget is correctly registered (not just checking that there are no exceptions) |
|
|
If you want to test something that something doesn't throw an exception, wrap it in a try..except, like so: try: … |
|
|
This test should verify that the widget is correctly unregistered (not just checking that there are no exceptions) |
|
|
This test should verify that the widget is correctly registered (not just checking that there are no exceptions) |
|
|
There's really no reason to mark this string for translation. |
|
|
Can you swap the order of these two methods? |
|
|
No blank line here. |
|
|
"adding a new widget ..." |
|
|
This would be better using assertIn(TestWidget, secondary_widgets). Same below. |
|
|
Should be a ValueError. |
|
|
Col: 24 E128 continuation line under-indented for visual indent |
![]() |
Description: |
|
---|
Summary: |
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||
Testing Done: |
|
|||||||||||||||
Commit: |
|
|||||||||||||||
Diff: |
Revision 2 (+112 -18) |

-
Tool: Pyflakes Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py
-
-
reviewboard/extensions/tests.py (Diff revision 2) If you want to test something that something doesn't throw an exception, wrap it in a
try
..except
, like so:try: some_fn() except SomeException: self.fail('some_fn raised SomeException')
Same for
test_unregister
andtest_register_with_primary
-
-
reviewboard/extensions/tests.py (Diff revision 2) This test should verify that the widget is correctly registered (not just checking that there are no exceptions)
-
reviewboard/extensions/tests.py (Diff revision 2) This test should verify that the widget is correctly unregistered (not just checking that there are no exceptions)
-
reviewboard/extensions/tests.py (Diff revision 2) This test should verify that the widget is correctly registered (not just checking that there are no exceptions)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+114 -18) |

-
Tool: PEP8 Style Checker Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: Pyflakes Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py
-
-
reviewboard/extensions/tests.py (Diff revision 3) There's really no reason to mark this string for translation.
-
Description: |
|
||||||
---|---|---|---|---|---|---|---|
Commit: |
|
||||||
Diff: |
Revision 4 (+113 -18) |

-
Tool: Pyflakes Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py
-
This looks great! Just a couple small things left.
-
-
-
reviewboard/extensions/tests.py (Diff revision 4) This would be better using
assertIn(TestWidget, secondary_widgets)
.Same below.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+111 -18) |

-
Tool: Pyflakes Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+111 -18) |

-
Tool: Pyflakes Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/widgets.py reviewboard/extensions/hooks.py reviewboard/extensions/tests.py
-
reviewboard/admin/widgets.py (Diff revision 6) Col: 24 E128 continuation line under-indented for visual indent
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+111 -18) |