mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 08:36:34 +00:00
[AZ-153] [AZ-155] [AZ-156] [AZ-158] Add augmentation, dataset formation, label validation, model split tests
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
|
||||
import constants
|
||||
|
||||
|
||||
def _split_encrypted(data: bytes):
|
||||
part_small_size = min(
|
||||
constants.SMALL_SIZE_KB * 1024, int(0.2 * len(data))
|
||||
)
|
||||
small = data[:part_small_size]
|
||||
big = data[part_small_size:]
|
||||
return small, big
|
||||
|
||||
|
||||
def test_bt_spl_01_split_respects_size_constraint():
|
||||
data = os.urandom(10000)
|
||||
small, _ = _split_encrypted(data)
|
||||
cap = max(constants.SMALL_SIZE_KB * 1024, int(0.2 * len(data)))
|
||||
assert len(small) <= cap
|
||||
|
||||
|
||||
def test_bt_spl_02_reassembly_equals_original():
|
||||
data = os.urandom(10000)
|
||||
small, big = _split_encrypted(data)
|
||||
assert small + big == data
|
||||
Reference in New Issue
Block a user