annotate tests/test_push_eol.py @ 1026:66395f232b7c

layouts: pull tag location list management into layout module We keep a list of locations within subversion where we look for tags that persists across runs. This pulls the logic for constructiong that list from config on first clone, and for mainting the list afterwards out of svnmeta and into layouts.
author David Schleimer <dschleimer@fb.com>
date Tue, 21 May 2013 16:29:18 -0700
parents 04729f3a3d17
children d741f536f23a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
1 import test_util
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
2
643
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 642
diff changeset
3 import unittest
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 642
diff changeset
4
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
5 class TestPushEol(test_util.TestBase):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
6 def setUp(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
7 test_util.TestBase.setUp(self)
865
04729f3a3d17 test_util: merge load_fixture_and_fetch() into TestBase method
Patrick Mezard <patrick@mezard.eu>
parents: 833
diff changeset
8 self._load_fixture_and_fetch('emptyrepo.svndump')
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
9
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
10 def _test_push_dirs(self, stupid):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
11 changes = [
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
12 # Root files with LF, CRLF and mixed EOL
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
13 ('lf', 'lf', 'a\nb\n\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
14 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
15 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
16 ]
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
17 self.commitchanges(changes)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
18 self.pushrevisions(stupid)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
19 self.assertchanges(changes, self.repo['tip'])
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
20
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
21 changes = [
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
22 # Update all files once, with same EOL
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
23 ('lf', 'lf', 'a\nb\n\nc\na\nb\n\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
24 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc\r\na\r\nb\r\n\r\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
25 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd\r\na\r\nb\n\r\nc\nd'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
26 ]
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
27 self.commitchanges(changes)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
28 self.pushrevisions(stupid)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
29 self.assertchanges(changes, self.repo['tip'])
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
30
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
31 def test_push_dirs(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
32 self._test_push_dirs(False)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
33
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
34 def test_push_dirs_stupid(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
35 self._test_push_dirs(True)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
36
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
37 def suite():
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
38 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol),
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
39 ]
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
40 return unittest.TestSuite(all_tests)