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

Side by Side Diff: Tools/Scripts/webkitpy/common/system/filesystem_unittest.py

Issue 493413002: Fix runtime error in copytree() MockFileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing comments Created 6 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
« no previous file with comments | « Tools/Scripts/webkitpy/common/system/filesystem_mock.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
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
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
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"))
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/common/system/filesystem_mock.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698