Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Side by Side Diff: scripts/slave/unittests/robust_tempdir_test.py

Issue 1879173003: annotated_run: extract robust_tempdir so it can be shared with kitchen_run (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: review Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/slave/unittests/annotated_run_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import unittest
8
9 import test_env # pylint: disable=W0403,W0611
10
11 from slave import robust_tempdir
12
13
14 class RobustTempdirTest(unittest.TestCase):
15 def test_empty(self):
16 with robust_tempdir.RobustTempdir(prefix='robust_tempdir_test'):
17 pass
18
19 def test_basic(self):
20 with robust_tempdir.RobustTempdir(prefix='robust_tempdir_test') as rt:
21 path = rt.tempdir()
22 self.assertTrue(os.path.exists(path))
23
24 self.assertFalse(os.path.exists(path))
25
26 def test_leak(self):
27 with robust_tempdir.RobustTempdir(
28 prefix='robust_tempdir_test', leak=True) as rt:
29 path = rt.tempdir()
30 self.assertTrue(os.path.exists(path))
31
32 self.assertTrue(os.path.exists(path))
33 os.rmdir(path)
34
35
36 if __name__ == '__main__':
37 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/unittests/annotated_run_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698