Coverage for mlos_bench/mlos_bench/tests/util_git_test.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-10-07 01:52 +0000

1# 

2# Copyright (c) Microsoft Corporation. 

3# Licensed under the MIT License. 

4# 

5"""Unit tests for get_git_info utility function.""" 

6import re 

7 

8from mlos_bench.util import get_git_info 

9 

10 

11def test_get_git_info() -> None: 

12 """Check that we can retrieve git info about the current repository correctly.""" 

13 (git_repo, git_commit, rel_path) = get_git_info(__file__) 

14 assert "mlos" in git_repo.lower() 

15 assert re.match(r"[0-9a-f]{40}", git_commit) is not None 

16 assert rel_path == "mlos_bench/mlos_bench/tests/util_git_test.py"