Skip to content

Commit 95d575c

Browse files
committed
Improved error reporting, update test of version command
1 parent 380e85a commit 95d575c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ filterwarnings =
44
ignore::DeprecationWarning
55
ignore::ResourceWarning
66

7-
addopts = -s --verbose
7+
addopts = -s --verbose --tb=short

test/test_main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import pytest
55
import semver
6+
from datetime import datetime
67

78
this_test_path = os.path.dirname(os.path.realpath(__file__))
89
# Calculate absolute path of the CLI
@@ -95,8 +96,8 @@ def test_command_version():
9596
result = run_command('version --format json')
9697
parsed_out = json.loads(result.stdout)
9798

98-
assert parsed_out.get('command', False) == 'arduino-cli'
99-
assert isinstance(semver.parse(parsed_out.get('version', False)), dict)
100-
assert isinstance(parsed_out.get('commit', False), str)
101-
assert parsed_out.get('build_date', False)
99+
assert parsed_out.get('Application', False) == 'arduino-cli'
100+
assert isinstance(semver.parse(parsed_out.get('VersionString', False)), dict)
101+
assert isinstance(parsed_out.get('Commit', False), str)
102+
assert datetime.strptime(parsed_out.get('BuildDate')[:-2], '%Y-%m-%dT%H:%M:%S.%f')
102103

0 commit comments

Comments
 (0)