diff options
author | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-09 22:40:52 (GMT) |
---|---|---|
committer | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-09 22:40:52 (GMT) |
commit | 3a7e06174766bfb40d64e16758543bdf313a134d (patch) | |
tree | 594f3dd0702f90d627189a00bc820b21bc17f1ca | |
parent | edcb036cb41913b242e1c00b4b71138b6eb602d8 (diff) | |
download | SCons-3a7e06174766bfb40d64e16758543bdf313a134d.zip SCons-3a7e06174766bfb40d64e16758543bdf313a134d.tar.gz SCons-3a7e06174766bfb40d64e16758543bdf313a134d.tar.bz2 |
Added testcases for new lines in Util.py
-rw-r--r-- | SCons/UtilTests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/SCons/UtilTests.py b/SCons/UtilTests.py index 4417ba5..74ea6e9 100644 --- a/SCons/UtilTests.py +++ b/SCons/UtilTests.py @@ -47,6 +47,7 @@ from SCons.Util import ( Selector, WhereIs, _attempt_init_of_python_3_9_hash_object, + _attempt_get_hash_function, _get_hash_object, _set_allowed_viable_default_hashes, adjustixes, @@ -941,6 +942,16 @@ class FIPSHashTestCase(unittest.TestCase): self.sys_v4_8 = unittest.mock.Mock(version_info=v4_8) ############################### + def basic_failover_bad_hashlib_hash_init(self): + """Tests that if the hashing function is entirely missing from hashlib (hashlib returns None), + the hash init function returns None""" + assert _attempt_init_of_python_3_9_hash_object(None) == None + + def basic_failover_bad_hashlib_hash_get(self): + """Tests that if the hashing function is entirely missing from hashlib (hashlib returns None), + the hash get function returns None""" + assert _attempt_get_hash_function("nonexist", self.no_algorithms) == None + def test_usedforsecurity_flag_behavior(self): """Test usedforsecurity flag -> should be set to 'True' on older versions of python, and 'False' on Python >= 3.9""" for version, expected in { |