1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from unittest
.mock
import Mock
12 from buildconfig
import topsrcdir
14 from mozbuild
.vendor
.vendor_python
import VendorPython
17 def test_up_to_date_vendor():
18 with tempfile
.TemporaryDirectory() as work_dir
:
19 subprocess
.check_call(["hg", "init", work_dir
])
20 os
.makedirs(os
.path
.join(work_dir
, "third_party"))
22 os
.path
.join(topsrcdir
, os
.path
.join("third_party", "python")),
23 os
.path
.join(work_dir
, os
.path
.join("third_party", "python")),
26 # Run the vendoring process
27 vendor
= VendorPython(
28 work_dir
, None, Mock(), topobjdir
=os
.path
.join(work_dir
, "obj")
32 # Verify that re-vendoring did not cause file changes.
33 # Note that we don't want hg-ignored generated files
34 # to bust the diff, so we exclude them (pycache, egg-info).
35 subprocess
.check_call(
39 os
.path
.join(topsrcdir
, os
.path
.join("third_party", "python")),
40 os
.path
.join(work_dir
, os
.path
.join("third_party", "python")),
41 "--exclude=__pycache__",
42 "--strip-trailing-cr",
47 if __name__
== "__main__":