blob: b427f4528b7495eecc1ab4b05738bc8bc55215d3 [file] [log] [blame]
# -*- coding: utf-8 -*-
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test suite for"""
from __future__ import print_function
import mock
import urllib
from chromite.lib import cros_test_lib
from chromite.lib import tree_status
# pylint: disable=protected-access
class TestGettingGardenerEmails(cros_test_lib.MockTestCase):
"""Tests functions related to retrieving the gardener's email address."""
def _SetEmails(self, emails):
gardener_json = ('{"updated_unix_timestamp":1547254144,'
'"emails":[%s]}' % emails)
response = mock.MagicMock(json=gardener_json, getcode=lambda: 200,
read=lambda: gardener_json)
self.PatchObject(urllib, 'urlopen', autospec=True,
def testParsingGardenerEmails(self):
# Test multiple gardeners.
self._SetEmails('"", ""')
['', ''])
class TestUrlConstruction(cros_test_lib.TestCase):
"""Tests functions that create URLs."""
def testConstructMiloBuildURL(self):
"""Tests generating Legoland build URLs."""
output = tree_status.ConstructMiloBuildURL('bbid')
expected = ''
self.assertEqual(output, expected)