Buckets:
ktongue/docker_container / .vscode-server /extensions /ms-python.vscode-python-envs-1.20.1-linux-arm64 /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" | |
| # The build ID is calculated via: | |
| # "1" + datetime.datetime.strptime(TEST_DATETIME,"%Y-%m-%d %H:%M:%S").strftime('%j%H%M') | |
| EXPECTED_BUILD_ID = "10730123" | |
| 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.21 kB
- Xet hash:
- b504e7913975f6735fe1bebb3f2bf61dd950e2ff4c04cbaae57ce437c323e157
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.