Adrià Vilanova Martínez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 4 | |
| 5 | """Unit tests for sitewide_views module.""" |
| 6 | from __future__ import print_function |
| 7 | from __future__ import division |
| 8 | from __future__ import absolute_import |
| 9 | |
| 10 | import unittest |
| 11 | |
Adrià Vilanova Martínez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 12 | from mrproto import usergroup_pb2 |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 13 | from sitewide import sitewide_views |
| 14 | |
| 15 | |
| 16 | class GroupViewTest(unittest.TestCase): |
| 17 | |
| 18 | def testConstructor(self): |
| 19 | group_settings = usergroup_pb2.MakeSettings('anyone') |
| 20 | view = sitewide_views.GroupView('groupname', 123, group_settings, 999) |
| 21 | |
| 22 | self.assertEqual('groupname', view.name) |
| 23 | self.assertEqual(123, view.num_members) |
| 24 | self.assertEqual('ANYONE', view.who_can_view_members) |
| 25 | self.assertEqual('/g/999/', view.detail_url) |