2012-04-17 13:23:35 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#-*- coding: utf-8 -*-
|
|
|
|
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license
|
|
|
|
# that can be found in the LICENSE file in the root of the source
|
|
|
|
# tree. An additional intellectual property rights grant can be found
|
|
|
|
# in the file PATENTS. All contributing project authors may
|
|
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
|
|
|
"""Unit test for the build status tracker script."""
|
|
|
|
|
|
|
|
|
|
|
|
import copy
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
import track_build_status
|
|
|
|
|
|
|
|
|
2013-01-18 14:44:21 +01:00
|
|
|
NORMAL_BOT_TO_STATUS_MAPPING = {
|
|
|
|
'1455--Win 64 Release': '455--OK',
|
|
|
|
'1455--CrOS': '900--failed',
|
|
|
|
'1455--Linux32 Debug': '344--OK',
|
|
|
|
'1456--Win Large Tests': '456--OK'}
|
2012-04-17 13:23:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TrackBuildStatusTest(unittest.TestCase):
|
2012-07-09 11:43:30 +02:00
|
|
|
|
|
|
|
def test_get_desired_bots(self):
|
|
|
|
bot_to_status_mapping = copy.deepcopy(NORMAL_BOT_TO_STATUS_MAPPING)
|
2013-01-18 14:44:21 +01:00
|
|
|
desired_bot_names = ['Linux32 Debug']
|
2013-03-07 10:59:43 +01:00
|
|
|
# pylint: disable=W0212
|
2013-01-18 14:44:21 +01:00
|
|
|
result = track_build_status._filter_undesired_bots(bot_to_status_mapping,
|
|
|
|
desired_bot_names)
|
2012-07-09 11:43:30 +02:00
|
|
|
self.assertEquals(1, len(result))
|
|
|
|
self.assertTrue(desired_bot_names[0] in result.keys()[0])
|
2012-04-17 13:23:35 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|