Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_windows_default():
"``briefcase create`` returns the Windows create msi command on Windows"
cmd, options = parse_cmdline('create'.split())
assert isinstance(cmd, WindowsMSICreateCommand)
assert cmd.platform == 'windows'
assert cmd.output_format == 'msi'
assert options == {'verbosity': 1}
def test_version_triple(first_app_config, tmp_path, version, version_triple):
command = WindowsMSICreateCommand(base_path=tmp_path)
first_app_config.version = version
context = command.output_format_template_context(first_app_config)
assert context['version_triple'] == version_triple
def test_explicit_version_triple(first_app_config, tmp_path):
command = WindowsMSICreateCommand(base_path=tmp_path)
first_app_config.version = '1.2.3a1'
first_app_config.version_triple = '2.3.4'
context = command.output_format_template_context(first_app_config)
# Explicit version triple is used.
assert context['version_triple'] == '2.3.4'
def test_explicit_guid(first_app_config, tmp_path):
"If a GUID is explicitly provided, it is used."
command = WindowsMSICreateCommand(base_path=tmp_path)
first_app_config.guid = 'e822176f-b755-589f-849c-6c6600f7efb1'
context = command.output_format_template_context(first_app_config)
# Explicitly provided GUID is used.
assert context['guid'] == 'e822176f-b755-589f-849c-6c6600f7efb1'
def test_distribution_path(first_app_config, tmp_path):
command = WindowsMSICreateCommand(base_path=tmp_path)
distribution_path = command.distribution_path(first_app_config)
assert distribution_path == tmp_path / 'windows' / 'First App-0.0.1.msi'
def test_binary_path(first_app_config, tmp_path):
command = WindowsMSICreateCommand(base_path=tmp_path)
binary_path = command.binary_path(first_app_config)
assert binary_path == tmp_path / 'windows' / 'First App' / 'src' / 'python' / 'pythonw.exe'
def test_bundle_path(first_app_config, tmp_path):
command = WindowsMSICreateCommand(base_path=tmp_path)
bundle_path = command.bundle_path(first_app_config)
assert bundle_path == tmp_path / 'windows' / 'First App'
def test_guid(first_app_config, tmp_path):
"A preictable GUID will be generated from the bundle."
command = WindowsMSICreateCommand(base_path=tmp_path)
context = command.output_format_template_context(first_app_config)
assert context['guid'] == 'd666a4f1-c7b7-52cc-888a-3a35a7cc97e5'