Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7124638
D3558.id12554.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3558.id12554.diff
View Options
diff --git a/swh/storage/tests/generate_data_test.py b/swh/storage/tests/generate_data_test.py
deleted file mode 100644
--- a/swh/storage/tests/generate_data_test.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (C) 2018 The Software Heritage developers
-# See the AUTHORS file at the top-level directory of this distribution
-# License: GNU General Public License version 3, or any later version
-# See top-level LICENSE file for more information
-
-from hypothesis.strategies import binary, composite, sets
-
-from swh.model.hashutil import MultiHash
-
-
-def gen_raw_content():
- """Generate raw content binary.
-
- """
- return binary(min_size=20, max_size=100)
-
-
-@composite
-def gen_contents(draw, *, min_size=0, max_size=100):
- """Generate valid and consistent content.
-
- Context: Test purposes
-
- Args:
- **draw**: Used by hypothesis to generate data
- **min_size** (int): Minimal number of elements to generate
- (default: 0)
- **max_size** (int): Maximal number of elements to generate
- (default: 100)
-
- Returns:
- [dict] representing contents. The list's size is between
- [min_size:max_size].
-
- """
- raw_contents = draw(sets(gen_raw_content(), min_size=min_size, max_size=max_size))
-
- contents = []
- for raw_content in raw_contents:
- contents.append(
- {
- "data": raw_content,
- "length": len(raw_content),
- "status": "visible",
- **MultiHash.from_data(raw_content).digest(),
- }
- )
-
- return contents
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 21 2024, 3:17 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3218583
Attached To
D3558: tests.generate_data_test: Remove dead code
Event Timeline
Log In to Comment