def test__gp_prefix__from_config(): config = configparser.ConfigParser() config["PATHS"] = { "gp.jar": "/path/to/the/gp.jar", } gp = GlobalPlatformProWrapper(config=config, dry_run=True) gp.process_config() assert gp.gp_prefix() == ["java", "-jar", "/path/to/the/gp.jar"]
def test_add_diversifier_flag_to_gp_prefix(div, diversifier_flag): config = configparser.ConfigParser() config["PATHS"] = { "gp.jar": "/path/to/the/gp.jar", } gp = GlobalPlatformProWrapper(config=config, dry_run=True) gp.process_config() gp.diversifier = div expected_cmd = [ "java", "-jar", "/path/to/the/gp.jar", ] if diversifier_flag: expected_cmd.append(diversifier_flag) assert gp.gp_prefix() == expected_cmd