| 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()
|
|
|