2016-04-16 00:38:16 +03:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2015-01-14 01:31:38 +03:00
|
|
|
import binascii
|
|
|
|
import itertools
|
2016-04-16 00:38:16 +03:00
|
|
|
import unittest
|
2015-01-14 01:31:38 +03:00
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
import silenttestrunner
|
2019-01-30 03:25:33 +03:00
|
|
|
from edenscm.mercurial import manifest as manifestmod, match as matchmod
|
2020-04-09 05:10:02 +03:00
|
|
|
from edenscm.mercurial.pycompat import encodeutf8
|
2020-01-31 11:16:29 +03:00
|
|
|
from hghave import require
|
2020-01-31 05:40:49 +03:00
|
|
|
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
EMTPY_MANIFEST = b""
|
|
|
|
|
|
|
|
HASH_1 = b"1" * 40
|
2015-04-01 01:06:55 +03:00
|
|
|
BIN_HASH_1 = binascii.unhexlify(HASH_1)
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
HASH_2 = b"f" * 40
|
2015-04-01 01:06:55 +03:00
|
|
|
BIN_HASH_2 = binascii.unhexlify(HASH_2)
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
HASH_3 = b"1234567890abcdef0987654321deadbeef0fcafe"
|
2015-04-01 01:06:55 +03:00
|
|
|
BIN_HASH_3 = binascii.unhexlify(HASH_3)
|
2015-01-14 01:31:38 +03:00
|
|
|
A_SHORT_MANIFEST = (
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
b"bar/baz/qux.py\0%(hash2)s%(flag2)s\n" b"foo\0%(hash1)s%(flag1)s\n"
|
|
|
|
) % {b"hash1": HASH_1, b"flag1": b"", b"hash2": HASH_2, b"flag2": b"l"}
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-03-28 08:26:41 +03:00
|
|
|
A_STEM_COMPRESSED_MANIFEST = (
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
b"\0\n"
|
|
|
|
b"\x00bar/baz/qux.py\0%(flag2)s\n%(hash2)s\n"
|
|
|
|
b"\x04qux/foo.py\0%(flag1)s\n%(hash1)s\n" # simple case of 4 stem chars
|
|
|
|
b"\x0az.py\0%(flag1)s\n%(hash1)s\n" # tricky newline = 10 stem characters
|
|
|
|
b"\x00%(verylongdir)sx/x\0\n%(hash1)s\n"
|
|
|
|
b"\xffx/y\0\n%(hash2)s\n" # more than 255 stem chars
|
|
|
|
) % {
|
|
|
|
b"hash1": BIN_HASH_1,
|
|
|
|
b"flag1": b"",
|
|
|
|
b"hash2": BIN_HASH_2,
|
|
|
|
b"flag2": b"l",
|
|
|
|
b"verylongdir": 255 * b"x",
|
|
|
|
}
|
2015-03-28 08:26:41 +03:00
|
|
|
|
2015-03-30 21:58:39 +03:00
|
|
|
A_DEEPER_MANIFEST = (
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
b"a/b/c/bar.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"a/b/c/bar.txt\0%(hash1)s%(flag1)s\n"
|
|
|
|
b"a/b/c/foo.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"a/b/c/foo.txt\0%(hash2)s%(flag2)s\n"
|
|
|
|
b"a/b/d/baz.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"a/b/d/qux.py\0%(hash1)s%(flag2)s\n"
|
|
|
|
b"a/b/d/ten.txt\0%(hash3)s%(flag2)s\n"
|
|
|
|
b"a/b/dog.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"a/b/fish.py\0%(hash2)s%(flag1)s\n"
|
|
|
|
b"a/c/london.py\0%(hash3)s%(flag2)s\n"
|
|
|
|
b"a/c/paper.txt\0%(hash2)s%(flag2)s\n"
|
|
|
|
b"a/c/paris.py\0%(hash2)s%(flag1)s\n"
|
|
|
|
b"a/d/apple.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"a/d/pizza.py\0%(hash3)s%(flag2)s\n"
|
|
|
|
b"a/green.py\0%(hash1)s%(flag2)s\n"
|
|
|
|
b"a/purple.py\0%(hash2)s%(flag1)s\n"
|
|
|
|
b"app.py\0%(hash3)s%(flag1)s\n"
|
|
|
|
b"readme.txt\0%(hash2)s%(flag1)s\n"
|
|
|
|
) % {
|
|
|
|
b"hash1": HASH_1,
|
|
|
|
b"flag1": b"",
|
|
|
|
b"hash2": HASH_2,
|
|
|
|
b"flag2": b"l",
|
|
|
|
b"hash3": HASH_3,
|
|
|
|
}
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2015-01-14 01:31:38 +03:00
|
|
|
HUGE_MANIFEST_ENTRIES = 200001
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
izip = getattr(itertools, "izip", zip)
|
|
|
|
if "xrange" not in globals():
|
2017-05-29 01:08:36 +03:00
|
|
|
xrange = range
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
A_HUGE_MANIFEST = b"".join(
|
|
|
|
sorted(
|
|
|
|
b"file%d\0%s%s\n" % (i, h, f)
|
|
|
|
for i, h, f in izip(
|
|
|
|
xrange(200001),
|
|
|
|
itertools.cycle((HASH_1, HASH_2)),
|
|
|
|
itertools.cycle((b"", b"x", b"l")),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
class basemanifesttests(object):
|
2015-04-08 01:16:19 +03:00
|
|
|
def parsemanifest(self, text):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
raise NotImplementedError("parsemanifest not implemented by test case")
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testEmptyManifest(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(EMTPY_MANIFEST)
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(0, len(m))
|
2015-03-26 00:13:46 +03:00
|
|
|
self.assertEqual([], list(m))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testManifest(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(["bar/baz/qux.py", "foo"], list(m))
|
|
|
|
self.assertEqual(BIN_HASH_2, m["bar/baz/qux.py"])
|
|
|
|
self.assertEqual("l", m.flags("bar/baz/qux.py"))
|
|
|
|
self.assertEqual(BIN_HASH_1, m["foo"])
|
|
|
|
self.assertEqual("", m.flags("foo"))
|
2017-05-13 21:52:44 +03:00
|
|
|
with self.assertRaises(KeyError):
|
2020-04-09 05:10:02 +03:00
|
|
|
m["wat"]
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testSetItem(self):
|
2015-04-01 01:06:55 +03:00
|
|
|
want = BIN_HASH_1
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(EMTPY_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
m["a"] = want
|
|
|
|
self.assertIn("a", m)
|
|
|
|
self.assertEqual(want, m["a"])
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(b"a\0" + HASH_1 + b"\n", m.text())
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
m["a"] = want
|
|
|
|
self.assertEqual(want, m["a"])
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(b"a\0" + HASH_1 + b"\n" + A_SHORT_MANIFEST, m.text())
|
2015-03-26 00:21:34 +03:00
|
|
|
|
2015-03-26 00:13:46 +03:00
|
|
|
def testSetFlag(self):
|
2020-04-09 05:10:02 +03:00
|
|
|
want = "x"
|
|
|
|
wantb = b"x"
|
2015-03-26 00:13:46 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(EMTPY_MANIFEST)
|
2015-03-26 00:13:46 +03:00
|
|
|
# first add a file; a file-less flag makes no sense
|
2020-04-09 05:10:02 +03:00
|
|
|
m["a"] = BIN_HASH_1
|
|
|
|
m.setflag("a", want)
|
|
|
|
self.assertEqual(want, m.flags("a"))
|
|
|
|
self.assertEqual(b"a\0" + HASH_1 + wantb + b"\n", m.text())
|
2015-03-26 00:13:46 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2015-03-26 00:13:46 +03:00
|
|
|
# first add a file; a file-less flag makes no sense
|
2020-04-09 05:10:02 +03:00
|
|
|
m["a"] = BIN_HASH_1
|
|
|
|
m.setflag("a", want)
|
|
|
|
self.assertEqual(want, m.flags("a"))
|
|
|
|
self.assertEqual(b"a\0" + HASH_1 + wantb + b"\n" + A_SHORT_MANIFEST, m.text())
|
2015-03-26 00:13:46 +03:00
|
|
|
|
2015-03-26 00:21:34 +03:00
|
|
|
def testCopy(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
m["a"] = BIN_HASH_1
|
2015-01-14 01:31:38 +03:00
|
|
|
m2 = m.copy()
|
|
|
|
del m
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
del m2 # make sure we don't double free() anything
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testCompaction(self):
|
|
|
|
unhex = binascii.unhexlify
|
|
|
|
h1, h2 = unhex(HASH_1), unhex(HASH_2)
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
m["alpha"] = h1
|
|
|
|
m["beta"] = h2
|
|
|
|
del m["foo"]
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
want = b"alpha\0%s\nbar/baz/qux.py\0%sl\nbeta\0%s\n" % (HASH_1, HASH_2, HASH_2)
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(want, m.text())
|
|
|
|
self.assertEqual(3, len(m))
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(["alpha", "bar/baz/qux.py", "beta"], list(m))
|
|
|
|
self.assertEqual(h1, m["alpha"])
|
|
|
|
self.assertEqual(h2, m["bar/baz/qux.py"])
|
|
|
|
self.assertEqual(h2, m["beta"])
|
|
|
|
self.assertEqual("", m.flags("alpha"))
|
|
|
|
self.assertEqual("l", m.flags("bar/baz/qux.py"))
|
|
|
|
self.assertEqual("", m.flags("beta"))
|
2017-05-13 21:52:44 +03:00
|
|
|
with self.assertRaises(KeyError):
|
2020-04-09 05:10:02 +03:00
|
|
|
m["foo"]
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testSetGetNodeSuffix(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
clean = self.parsemanifest(A_SHORT_MANIFEST)
|
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
h = m["foo"]
|
|
|
|
f = m.flags("foo")
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
want = h + b"a"
|
2015-01-14 01:31:38 +03:00
|
|
|
# Merge code wants to set 21-byte fake hashes at times
|
2020-04-09 05:10:02 +03:00
|
|
|
m["foo"] = want
|
|
|
|
self.assertEqual(want, m["foo"])
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(
|
2020-04-09 05:10:02 +03:00
|
|
|
[("bar/baz/qux.py", BIN_HASH_2), ("foo", BIN_HASH_1 + b"a")],
|
2020-02-01 04:29:30 +03:00
|
|
|
list(m.items()),
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
)
|
2015-01-14 01:31:38 +03:00
|
|
|
# Sometimes it even tries a 22-byte fake hash, but we can
|
|
|
|
# return 21 and it'll work out
|
2020-04-09 05:10:02 +03:00
|
|
|
m["foo"] = want + b"+"
|
|
|
|
self.assertEqual(want, m["foo"])
|
2015-01-14 01:31:38 +03:00
|
|
|
# make sure the suffix survives a copy
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("", "", ["re:foo"])
|
2015-03-26 00:13:46 +03:00
|
|
|
m2 = m.matches(match)
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(want, m2["foo"])
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(1, len(m2))
|
|
|
|
m2 = m.copy()
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(want, m2["foo"])
|
2015-01-14 01:31:38 +03:00
|
|
|
# suffix with iteration
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(
|
2020-04-09 05:10:02 +03:00
|
|
|
[("bar/baz/qux.py", BIN_HASH_2), ("foo", want)], list(m.items())
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
)
|
2015-03-26 00:13:46 +03:00
|
|
|
|
2015-01-14 01:31:38 +03:00
|
|
|
# shows up in diff
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual({"foo": ((want, f), (h, ""))}, m.diff(clean))
|
|
|
|
self.assertEqual({"foo": ((h, ""), (want, f))}, clean.diff(m))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-03-26 00:13:46 +03:00
|
|
|
def testMatchException(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("", "", ["re:.*"])
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
|
2015-01-14 01:31:38 +03:00
|
|
|
def filt(path):
|
2020-04-09 05:10:02 +03:00
|
|
|
if path == "foo":
|
2015-01-14 01:31:38 +03:00
|
|
|
assert False
|
|
|
|
return True
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
|
2015-03-26 00:13:46 +03:00
|
|
|
match.matchfn = filt
|
2017-05-13 21:52:44 +03:00
|
|
|
with self.assertRaises(AssertionError):
|
|
|
|
m.matches(match)
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testRemoveItem(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_SHORT_MANIFEST)
|
2020-04-09 05:10:02 +03:00
|
|
|
del m["foo"]
|
2017-05-13 21:52:44 +03:00
|
|
|
with self.assertRaises(KeyError):
|
2020-04-09 05:10:02 +03:00
|
|
|
m["foo"]
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(1, len(m))
|
|
|
|
self.assertEqual(1, len(list(m)))
|
2015-01-31 08:30:40 +03:00
|
|
|
# now restore and make sure everything works right
|
2020-04-09 05:10:02 +03:00
|
|
|
m["foo"] = b"a" * 20
|
2015-01-31 08:30:40 +03:00
|
|
|
self.assertEqual(2, len(m))
|
|
|
|
self.assertEqual(2, len(list(m)))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testManifestDiff(self):
|
2020-04-09 05:10:02 +03:00
|
|
|
MISSING = (None, "")
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
addl = b"z-only-in-left\0" + HASH_1 + b"\n"
|
|
|
|
addr = b"z-only-in-right\0" + HASH_2 + b"x\n"
|
2015-04-08 01:16:19 +03:00
|
|
|
left = self.parsemanifest(
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
A_SHORT_MANIFEST.replace(HASH_1, HASH_3 + b"x") + addl
|
|
|
|
)
|
2015-04-08 01:16:19 +03:00
|
|
|
right = self.parsemanifest(A_SHORT_MANIFEST + addr)
|
2015-01-14 01:31:38 +03:00
|
|
|
want = {
|
2020-04-09 05:10:02 +03:00
|
|
|
"foo": ((BIN_HASH_3, "x"), (BIN_HASH_1, "")),
|
|
|
|
"z-only-in-left": ((BIN_HASH_1, ""), MISSING),
|
|
|
|
"z-only-in-right": (MISSING, (BIN_HASH_2, "x")),
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
}
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(want, left.diff(right))
|
|
|
|
|
|
|
|
want = {
|
2020-04-09 05:10:02 +03:00
|
|
|
"bar/baz/qux.py": (MISSING, (BIN_HASH_2, "l")),
|
|
|
|
"foo": (MISSING, (BIN_HASH_3, "x")),
|
|
|
|
"z-only-in-left": (MISSING, (BIN_HASH_1, "")),
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
}
|
2015-04-08 01:16:19 +03:00
|
|
|
self.assertEqual(want, self.parsemanifest(EMTPY_MANIFEST).diff(left))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
want = {
|
2020-04-09 05:10:02 +03:00
|
|
|
"bar/baz/qux.py": ((BIN_HASH_2, "l"), MISSING),
|
|
|
|
"foo": ((BIN_HASH_3, "x"), MISSING),
|
|
|
|
"z-only-in-left": ((BIN_HASH_1, ""), MISSING),
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
}
|
2015-04-08 01:16:19 +03:00
|
|
|
self.assertEqual(want, left.diff(self.parsemanifest(EMTPY_MANIFEST)))
|
2015-01-14 01:31:38 +03:00
|
|
|
copy = right.copy()
|
2020-04-09 05:10:02 +03:00
|
|
|
del copy["z-only-in-right"]
|
|
|
|
del right["foo"]
|
2015-01-14 01:31:38 +03:00
|
|
|
want = {
|
2020-04-09 05:10:02 +03:00
|
|
|
"foo": (MISSING, (BIN_HASH_1, "")),
|
|
|
|
"z-only-in-right": ((BIN_HASH_2, "x"), MISSING),
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
}
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(want, right.diff(copy))
|
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
short = self.parsemanifest(A_SHORT_MANIFEST)
|
2015-01-14 01:31:38 +03:00
|
|
|
pruned = short.copy()
|
2020-04-09 05:10:02 +03:00
|
|
|
del pruned["foo"]
|
|
|
|
want = {"foo": ((BIN_HASH_1, ""), MISSING)}
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(want, short.diff(pruned))
|
2020-04-09 05:10:02 +03:00
|
|
|
want = {"foo": (MISSING, (BIN_HASH_1, ""))}
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(want, pruned.diff(short))
|
|
|
|
|
|
|
|
def testReversedLines(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
backwards = b"".join(
|
|
|
|
l + b"\n" for l in reversed(A_SHORT_MANIFEST.split(b"\n")) if l
|
|
|
|
)
|
2015-01-14 01:31:38 +03:00
|
|
|
try:
|
2015-04-08 01:16:19 +03:00
|
|
|
self.parsemanifest(backwards)
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.fail("Should have raised ValueError")
|
2015-06-24 08:20:08 +03:00
|
|
|
except ValueError as v:
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertIn("Manifest lines not in sorted order.", str(v))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testNoTerminalNewline(self):
|
|
|
|
try:
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.parsemanifest(A_SHORT_MANIFEST + b"wat")
|
|
|
|
self.fail("Should have raised ValueError")
|
2015-06-24 08:20:08 +03:00
|
|
|
except ValueError as v:
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertIn("Manifest did not end in a newline.", str(v))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testNoNewLineAtAll(self):
|
|
|
|
try:
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.parsemanifest(b"wat")
|
|
|
|
self.fail("Should have raised ValueError")
|
2015-06-24 08:20:08 +03:00
|
|
|
except ValueError as v:
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertIn("Manifest did not end in a newline.", str(v))
|
2015-01-14 01:31:38 +03:00
|
|
|
|
|
|
|
def testHugeManifest(self):
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_HUGE_MANIFEST)
|
2015-01-14 01:31:38 +03:00
|
|
|
self.assertEqual(HUGE_MANIFEST_ENTRIES, len(m))
|
|
|
|
self.assertEqual(len(m), len(list(m)))
|
|
|
|
|
2015-03-30 21:58:39 +03:00
|
|
|
def testMatchesMetadata(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for a few specific files to make sure that both
|
2015-03-30 21:58:39 +03:00
|
|
|
the set of files as well as their flags and nodeids are correct in
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
the resulting manifest."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_HUGE_MANIFEST)
|
2015-03-30 20:43:52 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", ["file1", "file200", "file300"], exact=True)
|
2015-03-30 20:43:52 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
w = (b"file1\0%sx\n" b"file200\0%sl\n" b"file300\0%s\n") % (
|
|
|
|
HASH_2,
|
|
|
|
HASH_1,
|
|
|
|
HASH_1,
|
|
|
|
)
|
2015-03-07 20:04:39 +03:00
|
|
|
self.assertEqual(w, m2.text())
|
2015-01-14 01:31:38 +03:00
|
|
|
|
2015-03-30 21:58:39 +03:00
|
|
|
def testMatchesNonexistentFile(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for a small set of specific files, including one
|
2015-03-30 21:58:39 +03:00
|
|
|
nonexistent file to make sure in only matches against existing files.
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
match = matchmod.match(
|
2020-04-09 05:10:02 +03:00
|
|
|
"/",
|
|
|
|
"",
|
|
|
|
["a/b/c/bar.txt", "a/b/d/qux.py", "readme.txt", "nonexistent"],
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
exact=True,
|
|
|
|
)
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(["a/b/c/bar.txt", "a/b/d/qux.py", "readme.txt"], m2.keys())
|
2015-03-30 21:58:39 +03:00
|
|
|
|
|
|
|
def testMatchesNonexistentDirectory(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for a relpath match on a directory that doesn't
|
|
|
|
actually exist."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", ["a/f"], default="relpath")
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
|
|
|
self.assertEqual([], m2.keys())
|
|
|
|
|
|
|
|
def testMatchesExactLarge(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for files matching a large list of exact files.
|
|
|
|
"""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_HUGE_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
|
|
|
flist = m.keys()[80:300]
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", flist, exact=True)
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
|
|
|
self.assertEqual(flist, m2.keys())
|
|
|
|
|
|
|
|
def testMatchesFull(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for what should be a full match."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", [""])
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
|
|
|
self.assertEqual(m.keys(), m2.keys())
|
|
|
|
|
|
|
|
def testMatchesDirectory(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() on a relpath match on a directory, which should
|
|
|
|
match against all files within said directory."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", ["a/b"], default="relpath")
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(
|
|
|
|
[
|
2020-04-09 05:10:02 +03:00
|
|
|
"a/b/c/bar.py",
|
|
|
|
"a/b/c/bar.txt",
|
|
|
|
"a/b/c/foo.py",
|
|
|
|
"a/b/c/foo.txt",
|
|
|
|
"a/b/d/baz.py",
|
|
|
|
"a/b/d/qux.py",
|
|
|
|
"a/b/d/ten.txt",
|
|
|
|
"a/b/dog.py",
|
|
|
|
"a/b/fish.py",
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
],
|
|
|
|
m2.keys(),
|
|
|
|
)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
|
|
|
def testMatchesExactPath(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() on an exact match on a directory, which should
|
2015-03-30 21:58:39 +03:00
|
|
|
result in an empty manifest because you can't perform an exact match
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
against a directory."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", ["a/b"], exact=True)
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
|
|
|
self.assertEqual([], m2.keys())
|
|
|
|
|
|
|
|
def testMatchesCwd(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() on a relpath match with the current directory ('.')
|
|
|
|
when not in the root directory."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "a/b", ["."], default="relpath")
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
self.assertEqual(
|
|
|
|
[
|
2020-04-09 05:10:02 +03:00
|
|
|
"a/b/c/bar.py",
|
|
|
|
"a/b/c/bar.txt",
|
|
|
|
"a/b/c/foo.py",
|
|
|
|
"a/b/c/foo.txt",
|
|
|
|
"a/b/d/baz.py",
|
|
|
|
"a/b/d/qux.py",
|
|
|
|
"a/b/d/ten.txt",
|
|
|
|
"a/b/dog.py",
|
|
|
|
"a/b/fish.py",
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
],
|
|
|
|
m2.keys(),
|
|
|
|
)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
|
|
|
def testMatchesWithPattern(self):
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
"""Tests matches() for files matching a pattern that reside
|
|
|
|
deeper than the specified directory."""
|
2015-04-08 01:16:19 +03:00
|
|
|
m = self.parsemanifest(A_DEEPER_MANIFEST)
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
match = matchmod.match("/", "", ["a/b/*/*.txt"])
|
2015-03-30 21:58:39 +03:00
|
|
|
m2 = m.matches(match)
|
|
|
|
|
2020-04-09 05:10:02 +03:00
|
|
|
self.assertEqual(["a/b/c/bar.txt", "a/b/c/foo.txt", "a/b/d/ten.txt"], m2.keys())
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
|
2015-03-30 21:58:39 +03:00
|
|
|
|
2015-04-08 01:16:19 +03:00
|
|
|
class testmanifestdict(unittest.TestCase, basemanifesttests):
|
|
|
|
def parsemanifest(self, text):
|
|
|
|
return manifestmod.manifestdict(text)
|
|
|
|
|
codemod: join the auto-formatter party
Summary:
Turned on the auto formatter. Ran `arc lint --apply-patches --take BLACK **/*.py`.
Then run `arc lint` again so some other autofixers like spellchecker etc. looked
at the code base. Manually accept the changes whenever they make sense, or use
a workaround (ex. changing "dict()" to "dict constructor") where autofix is false
positive. Disabled linters on files that are hard (i18n/polib.py) to fix, or less
interesting to fix (hgsubversion tests), or cannot be fixed without breaking
OSS build (FBPYTHON4).
Conflicted linters (test-check-module-imports.t, part of test-check-code.t,
test-check-pyflakes.t) are removed or disabled.
Duplicated linters (test-check-pyflakes.t, test-check-pylint.t) are removed.
An issue of the auto-formatter is lines are no longer guarnateed to be <= 80
chars. But that seems less important comparing with the benefit auto-formatter
provides.
As we're here, also remove test-check-py3-compat.t, as it is currently broken
if `PYTHON3=/bin/python3` is set.
Reviewed By: wez, phillco, simpkins, pkaush, singhsrb
Differential Revision: D8173629
fbshipit-source-id: 90e248ae0c5e6eaadbe25520a6ee42d32005621b
2018-05-26 07:34:37 +03:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2015-01-14 01:31:38 +03:00
|
|
|
silenttestrunner.main(__name__)
|