Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/data.py
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | _TEST_INDEXER_BASE_CONFIG = { | ||||
}, | }, | ||||
"indexer_storage": { | "indexer_storage": { | ||||
"cls": "memory", | "cls": "memory", | ||||
"args": {}, | "args": {}, | ||||
}, | }, | ||||
} | } | ||||
def random_sha1(): | def random_sha1_bytes() -> Sha1: | ||||
return hash_to_hex(bytes(random.randint(0, 255) for _ in range(20))) | return bytes(random.randint(0, 255) for _ in range(20)) | ||||
def random_sha256(): | def random_sha1() -> str: | ||||
return hash_to_hex(random_sha1_bytes()) | |||||
def random_sha256() -> str: | |||||
return hash_to_hex(bytes(random.randint(0, 255) for _ in range(32))) | return hash_to_hex(bytes(random.randint(0, 255) for _ in range(32))) | ||||
def random_blake2s256(): | def random_blake2s256() -> str: | ||||
return hash_to_hex(bytes(random.randint(0, 255) for _ in range(32))) | return hash_to_hex(bytes(random.randint(0, 255) for _ in range(32))) | ||||
def random_content(): | def random_content(): | ||||
return { | return { | ||||
"sha1": random_sha1(), | "sha1": random_sha1(), | ||||
"sha1_git": random_sha1(), | "sha1_git": random_sha1(), | ||||
"sha256": random_sha256(), | "sha256": random_sha256(), | ||||
"blake2s256": random_blake2s256(), | "blake2s256": random_blake2s256(), | ||||
} | } | ||||
vlorentz: this is dead code now | |||||
Done Inline ActionsSure. I misinterpreted you before thinking it would be good ot have anyways. Will remove. Ericson2314: Sure. I misinterpreted you before thinking it would be good ot have anyways. Will remove. | |||||
_TEST_MIMETYPE_INDEXER_CONFIG = merge_configs( | _TEST_MIMETYPE_INDEXER_CONFIG = merge_configs( | ||||
_TEST_INDEXER_BASE_CONFIG, | _TEST_INDEXER_BASE_CONFIG, | ||||
{ | { | ||||
"tools": { | "tools": { | ||||
"name": "file", | "name": "file", | ||||
"version": "1:5.30-1+deb9u1", | "version": "1:5.30-1+deb9u1", | ||||
"configuration": {"type": "library", "debian-package": "python3-magic"}, | "configuration": {"type": "library", "debian-package": "python3-magic"}, | ||||
▲ Show 20 Lines • Show All 465 Lines • Show Last 20 Lines |
this is dead code now