Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/mrproto/test/user_pb2_test.py b/mrproto/test/user_pb2_test.py
new file mode 100644
index 0000000..fcfed71
--- /dev/null
+++ b/mrproto/test/user_pb2_test.py
@@ -0,0 +1,28 @@
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Tests for user_pb2 functions."""
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+
+import unittest
+
+from mrproto import user_pb2
+
+
+class UserPb2Test(unittest.TestCase):
+
+ def testUser_Defaults(self):
+ user = user_pb2.MakeUser(111)
+ self.assertEqual(111, user.user_id)
+ self.assertFalse(user.obscure_email)
+ self.assertIsNone(user.email)
+
+ def testUser_Everything(self):
+ user = user_pb2.MakeUser(111, email='user@example.com', obscure_email=True)
+ self.assertEqual(111, user.user_id)
+ self.assertTrue(user.obscure_email)
+ self.assertEqual('user@example.com', user.email)