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

Side by Side Diff: tools/telemetry/third_party/pyfakefs/pyfakefs/example.py

Issue 1313163007: [Telemetry] Update pyfakefs to latest revision. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to 7e8e097c0165ba9d51fa9d34a0888d8ec082d15b Created 5 years, 3 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
OLDNEW
1 # Copyright 2014 Altera Corporation. All Rights Reserved. 1 # Copyright 2014 Altera Corporation. All Rights Reserved.
2 # Author: John McGehee 2 # Author: John McGehee
3 # 3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License. 5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at 6 # You may obtain a copy of the License at
7 # 7 #
8 # http://www.apache.org/licenses/LICENSE-2.0 8 # http://www.apache.org/licenses/LICENSE-2.0
9 # 9 #
10 # Unless required by applicable law or agreed to in writing, software 10 # Unless required by applicable law or agreed to in writing, software
(...skipping 11 matching lines...) Expand all
22 22
23 >>> os #doctest: +ELLIPSIS 23 >>> os #doctest: +ELLIPSIS
24 <fake_filesystem.FakeOsModule object...> 24 <fake_filesystem.FakeOsModule object...>
25 >>> os.path #doctest: +ELLIPSIS 25 >>> os.path #doctest: +ELLIPSIS
26 <fake_filesystem.FakePathModule object...> 26 <fake_filesystem.FakePathModule object...>
27 >>> glob #doctest: +ELLIPSIS 27 >>> glob #doctest: +ELLIPSIS
28 <fake_filesystem_glob.FakeGlobModule object...> 28 <fake_filesystem_glob.FakeGlobModule object...>
29 >>> shutil #doctest: +ELLIPSIS 29 >>> shutil #doctest: +ELLIPSIS
30 <fake_filesystem_shutil.FakeShutilModule object...> 30 <fake_filesystem_shutil.FakeShutilModule object...>
31 31
32 The `file()` and `open()` built-ins are bound to the fake `open()`: 32 The `open()` built-in is bound to the fake `open()`:
33 33
34 >>> file #doctest: +ELLIPSIS
35 <fake_filesystem.FakeFileOpen object...>
36 >>> open #doctest: +ELLIPSIS 34 >>> open #doctest: +ELLIPSIS
37 <fake_filesystem.FakeFileOpen object...> 35 <fake_filesystem.FakeFileOpen object...>
36
37 In Python 2 the `file()` built-in is also bound to the fake `open()`. `file()`
38 was eliminated in Python 3.
38 """ 39 """
39 40
40 import os 41 import os
41 import glob 42 import glob
42 import shutil 43 import shutil
43 44
44 def create_file(path): 45 def create_file(path):
45 '''Create the specified file and add some content to it. Use the `open()` 46 '''Create the specified file and add some content to it. Use the `open()`
46 built in function. 47 built in function.
47 48
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 >>> create_file('/test/file1.txt') 112 >>> create_file('/test/file1.txt')
112 >>> create_file('/test/file2.txt') 113 >>> create_file('/test/file2.txt')
113 >>> get_glob('/test/file*.txt') 114 >>> get_glob('/test/file*.txt')
114 ['/test/file1.txt', '/test/file2.txt'] 115 ['/test/file1.txt', '/test/file2.txt']
115 ''' 116 '''
116 return glob.glob(glob_path) 117 return glob.glob(glob_path)
117 118
118 def rm_tree(path): 119 def rm_tree(path):
119 '''Delete the specified file hierarchy.''' 120 '''Delete the specified file hierarchy.'''
120 shutil.rmtree(path) 121 shutil.rmtree(path)
OLDNEW
« no previous file with comments | « tools/telemetry/third_party/pyfakefs/pyfakefs/COPYING ('k') | tools/telemetry/third_party/pyfakefs/pyfakefs/example_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698