Buckets:
Sleepyfx/my-trading-vscode / vscode /code-server /extensions /ms-python.vscode-python-envs-1.28.0-universal /build /test_update_ext_version.py
| # Copyright (c) Microsoft Corporation. All rights reserved. | |
| # Licensed under the MIT License. | |
| import json | |
| import freezegun | |
| import pytest | |
| import update_ext_version | |
| TEST_DATETIME = "2022-03-14 01:23:45" | |
| def create_package_json(directory, version): | |
| """Create `package.json` in `directory` with a specified version of `version`.""" | |
| package_json = directory / "package.json" | |
| package_json.write_text(json.dumps({"version": version}), encoding="utf-8") | |
| return package_json | |
| def run_test(tmp_path, version, args, expected): | |
| package_json = create_package_json(tmp_path, version) | |
| update_ext_version.main(package_json, args) | |
| package = json.loads(package_json.read_text(encoding="utf-8")) | |
| assert expected == update_ext_version.parse_version(package["version"]) | |
| def test_invalid_args(tmp_path, version, args): | |
| with pytest.raises(ValueError): | |
| run_test(tmp_path, version, args, None) | |
| def test_update_ext_version(tmp_path, version, args, expected): | |
| run_test(tmp_path, version, args, expected) | |
Xet Storage Details
- Size:
- 3 kB
- Xet hash:
- e56955a8ae24dea0547b1c137f3c8fca343925749d1ab18f598c6358ff4b5d39
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.