OLD | NEW |
1 # vim: set fileencoding=utf-8 : | 1 # vim: set fileencoding=utf-8 : |
2 # Copyright (C) 2010 Google Inc. All rights reserved. | 2 # Copyright (C) 2010 Google Inc. All rights reserved. |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 def test_rmtree(self): | 112 def test_rmtree(self): |
113 self.fs.chdir(self.generic_test_dir) | 113 self.fs.chdir(self.generic_test_dir) |
114 self.fs.rmtree('foo') | 114 self.fs.rmtree('foo') |
115 self.assertTrue(self.fs.exists('foodir')) | 115 self.assertTrue(self.fs.exists('foodir')) |
116 self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz'))) | 116 self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz'))) |
117 self.fs.rmtree('foodir') | 117 self.fs.rmtree('foodir') |
118 self.assertFalse(self.fs.exists('foodir')) | 118 self.assertFalse(self.fs.exists('foodir')) |
119 self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz'))) | 119 self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz'))) |
120 | 120 |
| 121 def test_copytree(self): |
| 122 self.fs.chdir(self.generic_test_dir) |
| 123 self.fs.copytree('foodir/', 'bardir/') |
| 124 self.assertTrue(self.fs.exists('bardir')) |
| 125 self.assertTrue(self.fs.exists(self.fs.join('bardir', 'baz'))) |
121 | 126 |
122 class RealFileSystemTest(unittest.TestCase, GenericFileSystemTests): | 127 class RealFileSystemTest(unittest.TestCase, GenericFileSystemTests): |
123 def setUp(self): | 128 def setUp(self): |
124 self.fs = FileSystem() | 129 self.fs = FileSystem() |
125 self.setup_generic_test_dir() | 130 self.setup_generic_test_dir() |
126 | 131 |
127 self._this_dir = os.path.dirname(os.path.abspath(__file__)) | 132 self._this_dir = os.path.dirname(os.path.abspath(__file__)) |
128 self._missing_file = os.path.join(self._this_dir, 'missing_file.py') | 133 self._missing_file = os.path.join(self._this_dir, 'missing_file.py') |
129 self._this_file = os.path.join(self._this_dir, 'filesystem_unittest.py') | 134 self._this_file = os.path.join(self._this_dir, 'filesystem_unittest.py') |
130 | 135 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 fs = FileSystem() | 306 fs = FileSystem() |
302 self.assertTrue(fs.remove('filename', remove_with_exception)) | 307 self.assertTrue(fs.remove('filename', remove_with_exception)) |
303 self.assertEqual(-1, RealFileSystemTest._remove_failures) | 308 self.assertEqual(-1, RealFileSystemTest._remove_failures) |
304 | 309 |
305 def test_sep(self): | 310 def test_sep(self): |
306 fs = FileSystem() | 311 fs = FileSystem() |
307 | 312 |
308 self.assertEqual(fs.sep, os.sep) | 313 self.assertEqual(fs.sep, os.sep) |
309 self.assertEqual(fs.join("foo", "bar"), | 314 self.assertEqual(fs.join("foo", "bar"), |
310 os.path.join("foo", "bar")) | 315 os.path.join("foo", "bar")) |
OLD | NEW |