OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import shutil | 6 import shutil |
7 import socket | 7 import socket |
8 import tempfile | 8 import tempfile |
9 import unittest | 9 import unittest |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 socket_filename = os.path.join(sandbox_directory, 'named_socket') | 48 socket_filename = os.path.join(sandbox_directory, 'named_socket') |
49 the_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | 49 the_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
50 the_socket.bind(socket_filename) | 50 the_socket.bind(socket_filename) |
51 | 51 |
52 def testIsPseudoFile(self): | 52 def testIsPseudoFile(self): |
53 sandbox_dir = os.path.join(self.test_directory, "sandbox") | 53 sandbox_dir = os.path.join(self.test_directory, "sandbox") |
54 self._CreateFunkyFilesAndOnePlainFile(sandbox_dir) | 54 self._CreateFunkyFilesAndOnePlainFile(sandbox_dir) |
55 | 55 |
56 # If we can copy the directory, we're golden! | 56 # If we can copy the directory, we're golden! |
57 sandbox_dir_copy = os.path.join(self.test_directory, "sandbox_copy") | 57 sandbox_dir_copy = os.path.join(self.test_directory, "sandbox_copy") |
58 # pylint: disable=W0212 | 58 # pylint: disable=protected-access |
59 shutil.copytree(sandbox_dir, sandbox_dir_copy, | 59 shutil.copytree(sandbox_dir, sandbox_dir_copy, |
60 ignore=profile_generator._IsPseudoFile) | 60 ignore=profile_generator._IsPseudoFile) |
61 | 61 |
62 # Check that only the directory and plain file got copied. | 62 # Check that only the directory and plain file got copied. |
63 dir_contents = os.listdir(sandbox_dir_copy) | 63 dir_contents = os.listdir(sandbox_dir_copy) |
64 dir_contents.sort() | 64 dir_contents.sort() |
65 self.assertEqual(['directory', 'plain_file'], dir_contents) | 65 self.assertEqual(['directory', 'plain_file'], dir_contents) |
66 | 66 |
67 def tearDown(self): | 67 def tearDown(self): |
68 shutil.rmtree(self.test_directory) | 68 shutil.rmtree(self.test_directory) |
OLD | NEW |