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

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

Issue 2896423004: webkitpy: Remove contents of directory. (Closed)
Patch Set: Fixing tests. Created 3 years, 6 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 | « third_party/WebKit/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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 def test_rmtree(self): 113 def test_rmtree(self):
114 self.fs.chdir(self.generic_test_dir) 114 self.fs.chdir(self.generic_test_dir)
115 self.fs.rmtree('foo') 115 self.fs.rmtree('foo')
116 self.assertTrue(self.fs.exists('foodir')) 116 self.assertTrue(self.fs.exists('foodir'))
117 self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz'))) 117 self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz')))
118 self.fs.rmtree('foodir') 118 self.fs.rmtree('foodir')
119 self.assertFalse(self.fs.exists('foodir')) 119 self.assertFalse(self.fs.exists('foodir'))
120 self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz'))) 120 self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz')))
121 121
122 def test_remove_contents(self):
123 self.fs.chdir(self.generic_test_dir)
124
125 self.assertTrue(self.fs.exists('foodir'))
126 self.assertTrue(self.fs.exists(self.fs.join('foodir', 'baz')))
127 self.assertTrue(self.fs.remove_contents('foodir'))
128 self.assertTrue(self.fs.exists('foodir'))
129 self.assertFalse(self.fs.exists(self.fs.join('foodir', 'baz')))
130
122 def test_copytree(self): 131 def test_copytree(self):
123 self.fs.chdir(self.generic_test_dir) 132 self.fs.chdir(self.generic_test_dir)
124 self.fs.copytree('foodir/', 'bardir/') 133 self.fs.copytree('foodir/', 'bardir/')
125 self.assertTrue(self.fs.exists('bardir')) 134 self.assertTrue(self.fs.exists('bardir'))
126 self.assertTrue(self.fs.exists(self.fs.join('bardir', 'baz'))) 135 self.assertTrue(self.fs.exists(self.fs.join('bardir', 'baz')))
127 136
128 def test_move(self): 137 def test_move(self):
129 self.fs.chdir(self.generic_test_dir) 138 self.fs.chdir(self.generic_test_dir)
130 self.fs.move('foo.txt', 'bar.txt') 139 self.fs.move('foo.txt', 'bar.txt')
131 self.assertFalse(self.fs.exists('foo.txt')) 140 self.assertFalse(self.fs.exists('foo.txt'))
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 fs = FileSystem() 328 fs = FileSystem()
320 self.assertTrue(fs.remove('filename', remove_with_exception)) 329 self.assertTrue(fs.remove('filename', remove_with_exception))
321 self.assertEqual(-1, RealFileSystemTest._remove_failures) 330 self.assertEqual(-1, RealFileSystemTest._remove_failures)
322 331
323 def test_sep(self): 332 def test_sep(self):
324 fs = FileSystem() 333 fs = FileSystem()
325 334
326 self.assertEqual(fs.sep, os.sep) 335 self.assertEqual(fs.sep, os.sep)
327 self.assertEqual(fs.join('foo', 'bar'), 336 self.assertEqual(fs.join('foo', 'bar'),
328 os.path.join('foo', 'bar')) 337 os.path.join('foo', 'bar'))
OLDNEW
« no previous file with comments | « third_party/WebKit/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