Mercurial > hgsubversion
annotate tests/test_push_eol.py @ 1081:c8d0f5983571
tests: cd to tempdir during setUp
Since we were running hg clone from the hgsubversion repo, we would
often pick up config settings from hgsubversion/.hg/hgrc, including
loading extensions. This caused tests to fail for me when they
asserted that obsolete is disabled because I have evolve enabled in my
hgsubversion checkout. This was probably decreasing the overall
stability of the test suite as well, since it meant that clones were
running with pretty much arbitrary configs settings.
Interestingly, the setUp was already keeping a record of the cwd
before creating the tempdir, and tearDown was already cd-ing back to
that directory.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Wed, 14 Aug 2013 17:33:40 -0700 |
parents | 23992b41b6b7 |
children |
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): |
1055
2d7398fffd0d
push: obsolete rather than rebase & strip when enabled
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1044
diff
changeset
|
6 obsolete_mode_tests = True |
1072
23992b41b6b7
test_push_eol: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1055
diff
changeset
|
7 stupid_mode_tests = True |
1055
2d7398fffd0d
push: obsolete rather than rebase & strip when enabled
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
1044
diff
changeset
|
8 |
642
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
9 def setUp(self): |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
10 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
|
11 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
|
12 |
1072
23992b41b6b7
test_push_eol: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1055
diff
changeset
|
13 def test_push_dirs(self): |
642
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
14 changes = [ |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
15 # 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
|
16 ('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
|
17 ('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
|
18 ('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
|
19 ] |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
20 self.commitchanges(changes) |
1072
23992b41b6b7
test_push_eol: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1055
diff
changeset
|
21 self.pushrevisions() |
642
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
22 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
|
23 |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
24 changes = [ |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
25 # 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
|
26 ('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
|
27 ('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
|
28 ('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
|
29 ] |
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
30 self.commitchanges(changes) |
1072
23992b41b6b7
test_push_eol: use stupid mode metaclass
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1055
diff
changeset
|
31 self.pushrevisions() |
642
c2d606a1dc6f
tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
96
diff
changeset
|
32 self.assertchanges(changes, self.repo['tip']) |