blob: c02b719d6b005b37575c66e87d429032ba07ffb2 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file or at
4# https://developers.google.com/open-source/licenses/bsd
5
6"""Tests for user_pb2 functions."""
7
8from __future__ import print_function
9from __future__ import division
10from __future__ import absolute_import
11
12import unittest
13
14from proto import user_pb2
15
16
17class UserPb2Test(unittest.TestCase):
18
19 def testUser_Defaults(self):
20 user = user_pb2.MakeUser(111)
21 self.assertEqual(111, user.user_id)
22 self.assertFalse(user.obscure_email)
23 self.assertIsNone(user.email)
24
25 def testUser_Everything(self):
26 user = user_pb2.MakeUser(111, email='user@example.com', obscure_email=True)
27 self.assertEqual(111, user.user_id)
28 self.assertTrue(user.obscure_email)
29 self.assertEqual('user@example.com', user.email)