Misc Opts
This commit is contained in:
@@ -99,6 +99,43 @@ class CliLazyImportTests(unittest.TestCase):
|
||||
result["modules"],
|
||||
)
|
||||
|
||||
def test_lightweight_setup_command_stays_light(self):
|
||||
result = self.run_python(
|
||||
textwrap.dedent(
|
||||
f"""
|
||||
import json
|
||||
import sys
|
||||
from click.testing import CliRunner
|
||||
|
||||
sys.path.insert(0, {str(SRC_ROOT)!r})
|
||||
|
||||
import ffx.cli
|
||||
|
||||
runner = CliRunner()
|
||||
invoke_result = runner.invoke(
|
||||
ffx.cli.ffx,
|
||||
["--dry-run", "setup", "--check", "--with-tests"],
|
||||
)
|
||||
if invoke_result.exit_code != 0:
|
||||
raise SystemExit(invoke_result.output)
|
||||
|
||||
print(json.dumps({{
|
||||
"output": invoke_result.output,
|
||||
"modules": {{
|
||||
module_name: module_name in sys.modules
|
||||
for module_name in {HEAVY_MODULES!r}
|
||||
}},
|
||||
}}))
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
self.assertIn("tools/setup.sh --check --with-tests", result["output"])
|
||||
self.assertTrue(
|
||||
all(not is_loaded for is_loaded in result["modules"].values()),
|
||||
result["modules"],
|
||||
)
|
||||
|
||||
def test_convert_help_describes_absolute_and_percent_cpu_limits(self):
|
||||
result = self.run_python(
|
||||
textwrap.dedent(
|
||||
|
||||
Reference in New Issue
Block a user