mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
formatting
This commit is contained in:
parent
5fc0b1bdc3
commit
31a5b5cb76
6 changed files with 51 additions and 60 deletions
|
|
@ -38,7 +38,7 @@ def test_caesar_cipher_encryption():
|
|||
"""Test the Caesar cipher encryption logic"""
|
||||
config = CaesarCipherConfig(size=1, seed=42)
|
||||
dataset = CaesarCipherDataset(config)
|
||||
|
||||
|
||||
# Test with known rotation
|
||||
text = "HELLO"
|
||||
encrypted = dataset._caesar_encrypt(text, 1)
|
||||
|
|
@ -55,34 +55,27 @@ def test_caesar_cipher_encryption():
|
|||
|
||||
def test_caesar_cipher_dataset_items():
|
||||
"""Test basic properties of generated items"""
|
||||
config = CaesarCipherConfig(
|
||||
min_words=3,
|
||||
max_words=5,
|
||||
min_rotation=1,
|
||||
max_rotation=3,
|
||||
size=10,
|
||||
seed=42
|
||||
)
|
||||
config = CaesarCipherConfig(min_words=3, max_words=5, min_rotation=1, max_rotation=3, size=10, seed=42)
|
||||
dataset = CaesarCipherDataset(config)
|
||||
|
||||
for i in range(len(dataset)):
|
||||
item = dataset[i]
|
||||
|
||||
|
||||
# Check item structure
|
||||
assert isinstance(item, dict)
|
||||
assert "question" in item
|
||||
assert "answer" in item
|
||||
assert "metadata" in item
|
||||
|
||||
|
||||
# Check metadata
|
||||
assert "rotation" in item["metadata"]
|
||||
assert "cipher_text" in item["metadata"]
|
||||
assert "clear_text" in item["metadata"]
|
||||
|
||||
|
||||
# Verify rotation constraints
|
||||
rotation = item["metadata"]["rotation"]
|
||||
assert config.min_rotation <= rotation <= config.max_rotation
|
||||
|
||||
|
||||
# Verify text properties
|
||||
clear_text = item["metadata"]["clear_text"]
|
||||
words = clear_text.split()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue