OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Swarming Authors. All rights reserved. | 2 # Copyright 2013 The Swarming Authors. All rights reserved. |
3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 import tempfile | 11 import tempfile |
12 import time | 12 import time |
13 import unittest | 13 import unittest |
14 | 14 |
15 THIS_FILE = os.path.abspath(__file__) | 15 THIS_FILE = os.path.abspath(__file__) |
16 | 16 |
17 import test_env | 17 import test_env |
18 test_env.setup_test_env() | 18 test_env.setup_test_env() |
19 | 19 |
20 # Creates a server mock for functions in net.py. | 20 # Creates a server mock for functions in net.py. |
21 import net_utils | 21 import net_utils |
22 | 22 |
| 23 from utils import logging_utils |
23 from utils import net | 24 from utils import net |
24 from utils import zip_package | 25 from utils import zip_package |
25 import bot | 26 import bot |
26 import bot_config | 27 import bot_config |
27 import bot_main | 28 import bot_main |
28 import logging_utils | |
29 import os_utilities | 29 import os_utilities |
30 import xsrf_client | 30 import xsrf_client |
31 | 31 |
32 | 32 |
33 # Access to a protected member XX of a client class - pylint: disable=W0212 | 33 # Access to a protected member XX of a client class - pylint: disable=W0212 |
34 | 34 |
35 | 35 |
36 class TestBotMain(net_utils.TestCase): | 36 class TestBotMain(net_utils.TestCase): |
37 def setUp(self): | 37 def setUp(self): |
38 super(TestBotMain, self).setUp() | 38 super(TestBotMain, self).setUp() |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 476 |
477 self.assertEqual(0, bot_main.main([])) | 477 self.assertEqual(0, bot_main.main([])) |
478 | 478 |
479 | 479 |
480 if __name__ == '__main__': | 480 if __name__ == '__main__': |
481 if '-v' in sys.argv: | 481 if '-v' in sys.argv: |
482 unittest.TestCase.maxDiff = None | 482 unittest.TestCase.maxDiff = None |
483 logging.basicConfig( | 483 logging.basicConfig( |
484 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) | 484 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) |
485 unittest.main() | 485 unittest.main() |
OLD | NEW |