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

Unified Diff: tests/svn_utils_test.py

Issue 6020010: Destroy svn_utils.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Rebase against trunk and include a fix to import checkout directly Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/checkout_test.py ('k') | tests/svn_utils_test_data/codereview.settings » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/svn_utils_test.py
diff --git a/tests/svn_utils_test.py b/tests/svn_utils_test.py
deleted file mode 100755
index e78bf50ae8f1563e327086086bb5c3471a746de9..0000000000000000000000000000000000000000
--- a/tests/svn_utils_test.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unit tests for svn_utils.py."""
-
-import logging
-import os
-import shutil
-import sys
-import unittest
-
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.append(os.path.join(ROOT_DIR, '..'))
-
-import patch
-import svn_utils
-
-PATCH = """\
---- svn_utils_test.txt
-+++ svn_utils_test.txt
-@@ -3,6 +3,7 @@ bb
- ccc
- dd
- e
-+FOO!
- ff
- ggg
- hh
-"""
-
-def read(filename):
- f = open(filename, 'rb')
- content = f.read()
- f.close()
- return content
-
-
-class SvnUtils(unittest.TestCase):
- def setUp(self):
- super(SvnUtils, self).setUp()
- self.root_dir = os.path.join(ROOT_DIR, 'foo')
- if os.path.exists(self.root_dir):
- shutil.rmtree(self.root_dir)
-
- def tearDown(self):
- super(SvnUtils, self).tearDown()
- if os.path.exists(self.root_dir):
- shutil.rmtree(self.root_dir)
-
- def testModification(self):
- # A bit sad as it relies on the public server.
- url = ('http://src.chromium.org/svn/trunk/tools/commit-queue/tests/'
- 'svn_utils_test_data')
- svn_utils.revert(url, self.root_dir, None, None)
- content = read(os.path.join(self.root_dir, 'svn_utils_test.txt'))
- self.assertTrue(os.path.join(self.root_dir, 'svn_utils_test.txt'))
- patch.apply_patch(
- self.root_dir, patch.auto_mangle_git_patch(PATCH))
- content_lines = content.splitlines(True)
- content_modified = ''.join(content_lines[0:5] + ['FOO!\n'] +
- content_lines[5:])
- self.assertEquals(content_modified,
- read(os.path.join(self.root_dir, 'svn_utils_test.txt')))
- svn_utils.revert(url, self.root_dir, None, None)
- self.assertEquals(content,
- read(os.path.join(self.root_dir, 'svn_utils_test.txt')))
-
-
-if __name__ == '__main__':
- logging.basicConfig(level=logging.ERROR)
- unittest.main()
« no previous file with comments | « tests/checkout_test.py ('k') | tests/svn_utils_test_data/codereview.settings » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698