Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/tracker/test/template_helpers_test.py b/tracker/test/template_helpers_test.py
index 6c4a034..982e8bd 100644
--- a/tracker/test/template_helpers_test.py
+++ b/tracker/test/template_helpers_test.py
@@ -1,7 +1,6 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2018 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittest for the template helpers module."""
from __future__ import print_function
@@ -9,6 +8,7 @@
from __future__ import absolute_import
import logging
+import six
import unittest
import settings
@@ -18,7 +18,7 @@
from testing import testing_helpers
from tracker import template_helpers
from tracker import tracker_bizobj
-from proto import tracker_pb2
+from mrproto import tracker_pb2
class TemplateHelpers(unittest.TestCase):
@@ -87,7 +87,7 @@
self.assertFalse(parsed.component_required)
self.assertFalse(parsed.owner_defaults_to_member)
self.assertFalse(parsed.add_approvals)
- self.assertItemsEqual(parsed.phase_names, ['', '', '', '', '', ''])
+ six.assertCountEqual(self, parsed.phase_names, ['', '', '', '', '', ''])
self.assertEqual(parsed.approvals_to_phase_idx, {})
self.assertEqual(parsed.required_approval_ids, [])
@@ -139,10 +139,11 @@
self.assertFalse(parsed.owner_defaults_to_member)
self.assertTrue(parsed.add_approvals)
self.assertEqual(parsed.admin_str, 'jojwang@test.com, annajo@test.com')
- self.assertItemsEqual(parsed.phase_names,
- ['Canary', 'Stable-Exp', 'Stable', '', '', 'Oops'])
+ six.assertCountEqual(
+ self, parsed.phase_names,
+ ['Canary', 'Stable-Exp', 'Stable', '', '', 'Oops'])
self.assertEqual(parsed.approvals_to_phase_idx, {3: 2, 4: None})
- self.assertItemsEqual(parsed.required_approval_ids, [3, 4])
+ six.assertCountEqual(self, parsed.required_approval_ids, [3, 4])
def testGetTemplateInfoFromParsed_Normal(self):
self.config.field_defs.extend([self.fd_1, self.fd_2])
@@ -269,8 +270,7 @@
(prechecked_approvals, required_approval_ids,
phases) = template_helpers.GatherApprovalsPageData(
approval_values, tmpl_phases, self.config)
- self.assertItemsEqual(prechecked_approvals,
- ['4_phase_0', '5'])
+ six.assertCountEqual(self, prechecked_approvals, ['4_phase_0', '5'])
self.assertEqual(required_approval_ids, [4])
self.assertEqual(phases[0], tmpl_phases[1])
self.assertIsNone(phases[1].name)
@@ -280,8 +280,7 @@
approvals_to_phase_idx = {23: 0, 25: 1, 26: None}
checked = template_helpers.GetCheckedApprovalsFromParsed(
approvals_to_phase_idx)
- self.assertItemsEqual(checked,
- ['23_phase_0', '25_phase_1', '26'])
+ six.assertCountEqual(self, checked, ['23_phase_0', '25_phase_1', '26'])
def testGetIssueFromTemplate(self):
"""Can fill and return the templated issue"""