Skip to content

Commit d5cc675

Browse files
committed
Tweak CyberMetric tests
1 parent 91b2a3c commit d5cc675

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/cybermetric/test_cybermetric.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
EXAMPLE_QUESTION = {
1818
"question": "What is the primary requirement for an Random Bit Generator's (RBG) output to be used for generating cryptographic keys?",
1919
"answers": {
20-
"A": "The RBG's output should have a length that matches the target data to be protected.",
21-
"B": "The RBG's output should be computationally indistinguishable from random bits and provide sufficient entropy to support the security strength required for the target data.",
22-
"C": "The RBG's output should be as long as possible to ensure maximal randomness.",
23-
"D": "The RBG's output should have precisely the same length as the symmetric key to be generated.",
20+
"A": "The RBG's output should have a length that matches the target data to be protected",
21+
"B": "The RBG's output should be computationally indistinguishable from random bits and provide sufficient entropy to support the security strength required for the target data",
22+
"C": "The RBG's output should be as long as possible to ensure maximal randomness",
23+
"D": "The RBG's output should have precisely the same length as the symmetric key to be generated",
2424
},
2525
"solution": "B",
2626
}
@@ -34,17 +34,24 @@ def test_record_to_sample():
3434
# Assert Sample is populated accurately with correct types
3535
assert isinstance(sample.target, str)
3636
assert sample.target == EXAMPLE_QUESTION["solution"]
37+
assert sample.target == "B"
3738

3839
assert all(isinstance(choice, str) for choice in sample.choices)
3940
assert sample.choices == list(EXAMPLE_QUESTION["answers"].keys())
41+
assert sample.choices == ["A", "B", "C", "D"]
4042

4143
assert isinstance(sample.input, str)
4244
assert EXAMPLE_QUESTION["question"] in sample.input
4345

4446
# Assert each option is provided in input
4547
for option in EXAMPLE_QUESTION["answers"].values():
4648
assert option in sample.input
47-
return
49+
50+
expected_input = """Question: What is the primary requirement for an Random Bit Generator's (RBG) output to be used for generating cryptographic keys?
51+
Options: A) The RBG's output should have a length that matches the target data to be protected, B) The RBG's output should be computationally indistinguishable from random bits and provide sufficient entropy to support the security strength required for the target data, C) The RBG's output should be as long as possible to ensure maximal randomness, D) The RBG's output should have precisely the same length as the symmetric key to be generated
52+
53+
"""
54+
assert sample.input == expected_input
4855

4956

5057
def generate_task_state(sample: Sample, is_correct: bool) -> TaskState:

0 commit comments

Comments
 (0)