Skip to content

Commit

Permalink
Testing: Remove deprecated checksum tests; rucio#7008
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Nov 21, 2024
1 parent fc037c0 commit cec009d
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
import datetime
import logging
import os
from re import match

import pytest

from rucio.common.bittorrent import bittorrent_v2_merkle_sha256
from rucio.common.checksum import adler32, md5
from rucio.common.exception import InvalidType
from rucio.common.logging import formatted_logger
from rucio.common.utils import Availability, parse_did_filter_from_string, retrying
Expand All @@ -29,28 +27,6 @@
class TestUtils:
"""UTILS (COMMON): test utilisty functions"""

def test_utils_md5(self, file_factory):
"""(COMMON/UTILS): test calculating MD5 of a file"""
temp_file_1 = file_factory.file_generator(data='hello test\n')
ret = md5(temp_file_1)
assert isinstance(ret, str), "Object returned by utils.md5 is not a string"
assert match('[a-fA-F0-9]{32}', ret) is not None, "String returned by utils.md5 is not a md5 hex digest"
assert ret == '31d50dd6285b9ff9f8611d0762265d04', "Hex digest returned by utils.md5 is the MD5 checksum"

with pytest.raises(Exception, match='FATAL - could not get MD5 checksum of file no_file - \\[Errno 2\\] No such file or directory: \'no_file\''):
md5('no_file')

def test_utils_adler32(self, file_factory):
"""(COMMON/UTILS): test calculating Adler32 of a file"""
temp_file_1 = file_factory.file_generator(data='hello test\n')
ret = adler32(temp_file_1)
assert isinstance(ret, str)
assert match('[a-fA-F0-9]', ret) is not None
assert ret == '198d03ff'

with pytest.raises(Exception, match='FATAL - could not get Adler-32 checksum of file no_file: \\[Errno 2\\] No such file or directory: \'no_file\''):
adler32('no_file')

def test_parse_did_filter_string(self):
"""(COMMON/UTILS): test parsing of did filter string"""
test_cases = [{
Expand Down

0 comments on commit cec009d

Please sign in to comment.