Skip to content

Commit

Permalink
Set byte length for generated data
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob720 committed Jan 6, 2025
1 parent 3733a0b commit 8f12f93
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 202 deletions.
2 changes: 1 addition & 1 deletion src/aa_remove_data/pb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def generate_test_value(self, val: int) -> str | bytes | int:
if self.pv_type.endswith("STRING"):
return str(val)
elif self.pv_type.endswith("BYTE") or self.pv_type.endswith("BYTES"):
return val.to_bytes()
return val.to_bytes(2, byteorder="big")
else:
return val

Expand Down
Binary file modified tests/test_data/SCALAR_BYTE_test_data.pb
Binary file not shown.
200 changes: 100 additions & 100 deletions tests/test_data/SCALAR_BYTE_test_data.txt
Original file line number Diff line number Diff line change
@@ -1,102 +1,102 @@
test, SCALAR_BYTE, 2024
DATE SECONDS NANO VAL
2024-01-01 00:06:40 400 0 b'\x00'
2024-01-01 00:06:41 401 0 b'\x01'
2024-01-01 00:06:42 402 0 b'\x02'
2024-01-01 00:06:43 403 0 b'\x03'
2024-01-01 00:06:44 404 0 b'\x04'
2024-01-01 00:06:45 405 0 b'\x05'
2024-01-01 00:06:46 406 0 b'\x06'
2024-01-01 00:06:47 407 0 b'\x07'
2024-01-01 00:06:48 408 0 b'\x08'
2024-01-01 00:06:49 409 0 b'\t'
2024-01-01 00:06:50 410 0 b'\n'
2024-01-01 00:06:51 411 0 b'\x0b'
2024-01-01 00:06:52 412 0 b'\x0c'
2024-01-01 00:06:53 413 0 b'\r'
2024-01-01 00:06:54 414 0 b'\x0e'
2024-01-01 00:06:55 415 0 b'\x0f'
2024-01-01 00:06:56 416 0 b'\x10'
2024-01-01 00:06:57 417 0 b'\x11'
2024-01-01 00:06:58 418 0 b'\x12'
2024-01-01 00:06:59 419 0 b'\x13'
2024-01-01 00:07:00 420 0 b'\x14'
2024-01-01 00:07:01 421 0 b'\x15'
2024-01-01 00:07:02 422 0 b'\x16'
2024-01-01 00:07:03 423 0 b'\x17'
2024-01-01 00:07:04 424 0 b'\x18'
2024-01-01 00:07:05 425 0 b'\x19'
2024-01-01 00:07:06 426 0 b'\x1a'
2024-01-01 00:07:07 427 0 b'\x1b'
2024-01-01 00:07:08 428 0 b'\x1c'
2024-01-01 00:07:09 429 0 b'\x1d'
2024-01-01 00:07:10 430 0 b'\x1e'
2024-01-01 00:07:11 431 0 b'\x1f'
2024-01-01 00:07:12 432 0 b' '
2024-01-01 00:07:13 433 0 b'!'
2024-01-01 00:07:14 434 0 b'"'
2024-01-01 00:07:15 435 0 b'#'
2024-01-01 00:07:16 436 0 b'$'
2024-01-01 00:07:17 437 0 b'%'
2024-01-01 00:07:18 438 0 b'&'
2024-01-01 00:07:19 439 0 b"'"
2024-01-01 00:07:20 440 0 b'('
2024-01-01 00:07:21 441 0 b')'
2024-01-01 00:07:22 442 0 b'*'
2024-01-01 00:07:23 443 0 b'+'
2024-01-01 00:07:24 444 0 b','
2024-01-01 00:07:25 445 0 b'-'
2024-01-01 00:07:26 446 0 b'.'
2024-01-01 00:07:27 447 0 b'/'
2024-01-01 00:07:28 448 0 b'0'
2024-01-01 00:07:29 449 0 b'1'
2024-01-01 00:07:30 450 0 b'2'
2024-01-01 00:07:31 451 0 b'3'
2024-01-01 00:07:32 452 0 b'4'
2024-01-01 00:07:33 453 0 b'5'
2024-01-01 00:07:34 454 0 b'6'
2024-01-01 00:07:35 455 0 b'7'
2024-01-01 00:07:36 456 0 b'8'
2024-01-01 00:07:37 457 0 b'9'
2024-01-01 00:07:38 458 0 b':'
2024-01-01 00:07:39 459 0 b';'
2024-01-01 00:07:40 460 0 b'<'
2024-01-01 00:07:41 461 0 b'='
2024-01-01 00:07:42 462 0 b'>'
2024-01-01 00:07:43 463 0 b'?'
2024-01-01 00:07:44 464 0 b'@'
2024-01-01 00:07:45 465 0 b'A'
2024-01-01 00:07:46 466 0 b'B'
2024-01-01 00:07:47 467 0 b'C'
2024-01-01 00:07:48 468 0 b'D'
2024-01-01 00:07:49 469 0 b'E'
2024-01-01 00:07:50 470 0 b'F'
2024-01-01 00:07:51 471 0 b'G'
2024-01-01 00:07:52 472 0 b'H'
2024-01-01 00:07:53 473 0 b'I'
2024-01-01 00:07:54 474 0 b'J'
2024-01-01 00:07:55 475 0 b'K'
2024-01-01 00:07:56 476 0 b'L'
2024-01-01 00:07:57 477 0 b'M'
2024-01-01 00:07:58 478 0 b'N'
2024-01-01 00:07:59 479 0 b'O'
2024-01-01 00:08:00 480 0 b'P'
2024-01-01 00:08:01 481 0 b'Q'
2024-01-01 00:08:02 482 0 b'R'
2024-01-01 00:08:03 483 0 b'S'
2024-01-01 00:08:04 484 0 b'T'
2024-01-01 00:08:05 485 0 b'U'
2024-01-01 00:08:06 486 0 b'V'
2024-01-01 00:08:07 487 0 b'W'
2024-01-01 00:08:08 488 0 b'X'
2024-01-01 00:08:09 489 0 b'Y'
2024-01-01 00:08:10 490 0 b'Z'
2024-01-01 00:08:11 491 0 b'['
2024-01-01 00:08:12 492 0 b'\\'
2024-01-01 00:08:13 493 0 b']'
2024-01-01 00:08:14 494 0 b'^'
2024-01-01 00:08:15 495 0 b'_'
2024-01-01 00:08:16 496 0 b'`'
2024-01-01 00:08:17 497 0 b'a'
2024-01-01 00:08:18 498 0 b'b'
2024-01-01 00:08:19 499 0 b'c'
2024-01-01 00:06:40 400 0 b'\x00\x00'
2024-01-01 00:06:41 401 0 b'\x00\x01'
2024-01-01 00:06:42 402 0 b'\x00\x02'
2024-01-01 00:06:43 403 0 b'\x00\x03'
2024-01-01 00:06:44 404 0 b'\x00\x04'
2024-01-01 00:06:45 405 0 b'\x00\x05'
2024-01-01 00:06:46 406 0 b'\x00\x06'
2024-01-01 00:06:47 407 0 b'\x00\x07'
2024-01-01 00:06:48 408 0 b'\x00\x08'
2024-01-01 00:06:49 409 0 b'\x00\t'
2024-01-01 00:06:50 410 0 b'\x00\n'
2024-01-01 00:06:51 411 0 b'\x00\x0b'
2024-01-01 00:06:52 412 0 b'\x00\x0c'
2024-01-01 00:06:53 413 0 b'\x00\r'
2024-01-01 00:06:54 414 0 b'\x00\x0e'
2024-01-01 00:06:55 415 0 b'\x00\x0f'
2024-01-01 00:06:56 416 0 b'\x00\x10'
2024-01-01 00:06:57 417 0 b'\x00\x11'
2024-01-01 00:06:58 418 0 b'\x00\x12'
2024-01-01 00:06:59 419 0 b'\x00\x13'
2024-01-01 00:07:00 420 0 b'\x00\x14'
2024-01-01 00:07:01 421 0 b'\x00\x15'
2024-01-01 00:07:02 422 0 b'\x00\x16'
2024-01-01 00:07:03 423 0 b'\x00\x17'
2024-01-01 00:07:04 424 0 b'\x00\x18'
2024-01-01 00:07:05 425 0 b'\x00\x19'
2024-01-01 00:07:06 426 0 b'\x00\x1a'
2024-01-01 00:07:07 427 0 b'\x00\x1b'
2024-01-01 00:07:08 428 0 b'\x00\x1c'
2024-01-01 00:07:09 429 0 b'\x00\x1d'
2024-01-01 00:07:10 430 0 b'\x00\x1e'
2024-01-01 00:07:11 431 0 b'\x00\x1f'
2024-01-01 00:07:12 432 0 b'\x00 '
2024-01-01 00:07:13 433 0 b'\x00!'
2024-01-01 00:07:14 434 0 b'\x00"'
2024-01-01 00:07:15 435 0 b'\x00#'
2024-01-01 00:07:16 436 0 b'\x00$'
2024-01-01 00:07:17 437 0 b'\x00%'
2024-01-01 00:07:18 438 0 b'\x00&'
2024-01-01 00:07:19 439 0 b"\x00'"
2024-01-01 00:07:20 440 0 b'\x00('
2024-01-01 00:07:21 441 0 b'\x00)'
2024-01-01 00:07:22 442 0 b'\x00*'
2024-01-01 00:07:23 443 0 b'\x00+'
2024-01-01 00:07:24 444 0 b'\x00,'
2024-01-01 00:07:25 445 0 b'\x00-'
2024-01-01 00:07:26 446 0 b'\x00.'
2024-01-01 00:07:27 447 0 b'\x00/'
2024-01-01 00:07:28 448 0 b'\x000'
2024-01-01 00:07:29 449 0 b'\x001'
2024-01-01 00:07:30 450 0 b'\x002'
2024-01-01 00:07:31 451 0 b'\x003'
2024-01-01 00:07:32 452 0 b'\x004'
2024-01-01 00:07:33 453 0 b'\x005'
2024-01-01 00:07:34 454 0 b'\x006'
2024-01-01 00:07:35 455 0 b'\x007'
2024-01-01 00:07:36 456 0 b'\x008'
2024-01-01 00:07:37 457 0 b'\x009'
2024-01-01 00:07:38 458 0 b'\x00:'
2024-01-01 00:07:39 459 0 b'\x00;'
2024-01-01 00:07:40 460 0 b'\x00<'
2024-01-01 00:07:41 461 0 b'\x00='
2024-01-01 00:07:42 462 0 b'\x00>'
2024-01-01 00:07:43 463 0 b'\x00?'
2024-01-01 00:07:44 464 0 b'\x00@'
2024-01-01 00:07:45 465 0 b'\x00A'
2024-01-01 00:07:46 466 0 b'\x00B'
2024-01-01 00:07:47 467 0 b'\x00C'
2024-01-01 00:07:48 468 0 b'\x00D'
2024-01-01 00:07:49 469 0 b'\x00E'
2024-01-01 00:07:50 470 0 b'\x00F'
2024-01-01 00:07:51 471 0 b'\x00G'
2024-01-01 00:07:52 472 0 b'\x00H'
2024-01-01 00:07:53 473 0 b'\x00I'
2024-01-01 00:07:54 474 0 b'\x00J'
2024-01-01 00:07:55 475 0 b'\x00K'
2024-01-01 00:07:56 476 0 b'\x00L'
2024-01-01 00:07:57 477 0 b'\x00M'
2024-01-01 00:07:58 478 0 b'\x00N'
2024-01-01 00:07:59 479 0 b'\x00O'
2024-01-01 00:08:00 480 0 b'\x00P'
2024-01-01 00:08:01 481 0 b'\x00Q'
2024-01-01 00:08:02 482 0 b'\x00R'
2024-01-01 00:08:03 483 0 b'\x00S'
2024-01-01 00:08:04 484 0 b'\x00T'
2024-01-01 00:08:05 485 0 b'\x00U'
2024-01-01 00:08:06 486 0 b'\x00V'
2024-01-01 00:08:07 487 0 b'\x00W'
2024-01-01 00:08:08 488 0 b'\x00X'
2024-01-01 00:08:09 489 0 b'\x00Y'
2024-01-01 00:08:10 490 0 b'\x00Z'
2024-01-01 00:08:11 491 0 b'\x00['
2024-01-01 00:08:12 492 0 b'\x00\\'
2024-01-01 00:08:13 493 0 b'\x00]'
2024-01-01 00:08:14 494 0 b'\x00^'
2024-01-01 00:08:15 495 0 b'\x00_'
2024-01-01 00:08:16 496 0 b'\x00`'
2024-01-01 00:08:17 497 0 b'\x00a'
2024-01-01 00:08:18 498 0 b'\x00b'
2024-01-01 00:08:19 499 0 b'\x00c'
Binary file modified tests/test_data/V4_GENERIC_BYTES_test_data.pb
Binary file not shown.
Loading

0 comments on commit 8f12f93

Please sign in to comment.