Skip to content

Commit

Permalink
Update tzt suite
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed May 22, 2024
1 parent 8da5640 commit 2b410cc
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/pytezos/rpc/shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from binascii import hexlify
from datetime import datetime
from datetime import UTC, datetime
from functools import cached_property
from functools import lru_cache
from time import sleep
Expand Down Expand Up @@ -109,7 +109,7 @@ def wait_blocks(
while current_header['level'] < max_level:
logger.info('Current level: %d (max %d)', current_header['level'], max_level)
prev_block_dt = datetime.strptime(current_header['timestamp'], '%Y-%m-%dT%H:%M:%SZ')
elapsed_sec = (datetime.utcnow() - prev_block_dt).seconds
elapsed_sec = (datetime.now(UTC) - prev_block_dt).seconds
sleep_sec = 1 if elapsed_sec > time_between_blocks else (time_between_blocks - elapsed_sec + 1)

logger.info('Sleep %d seconds until block %s is superseded', sleep_sec, current_block_hash)
Expand Down
3 changes: 1 addition & 2 deletions tests/sandbox_tests/test_counter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging

from pytest import skip
from unittest import skip

from pytezos.rpc.errors import RpcError
from pytezos.sandbox.node import SandboxedNodeTestCase
Expand Down
76 changes: 74 additions & 2 deletions tests/unit_tests/test_michelson/test_repl/test_tzt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,29 @@ class TztTest(TestCase):
exclude = [
".git",
"LICENSE",
"coverage.md",
"README.md",
"macro_pack",
#
"add_00.tc.tzt",
"add_01.tc.tzt",
# NOTE: unknown primitive `MutezOverflow`
"add_mutez-mutez_01.tzt",
# NOTE: unknown primitive `Contract`
"address_00.tc.tzt",
"address_00.tzt",
"address_01.tzt",
"address_02.tzt",
"and_bytes-bytes_00.tzt",
"and_bytes-bytes_01.tzt",
"and_bytes-bytes_02.tzt",
"and_bytes-bytes_03.tzt",
"car_00.tc.tzt",
"cdr_00.tc.tzt",
"checksignature_00.tc.tzt",
"compare_00.tc.tzt",
"compare_01.tc.tzt",
"compare_02.tc.tzt",
"cons_lists_00.tc.tzt",
"contract_00.tzt",
"contract_01.tzt",
"contract_02.tzt",
Expand All @@ -30,27 +47,82 @@ class TztTest(TestCase):
# NOTE: failed to parse expression LexToken(_,'_',1,658)
"createcontract_00.tzt",
"createcontract_01.tzt",
"dip_00.tc.tzt",
"dipn_00.tc.tzt",
"dipn_01.tc.tzt",
"dipn_02.tc.tzt",
"drop_00.tc.tzt",
"dropn_00.tc.tzt",
"dup_00.tc.tzt",
"dupn_00.tc.tzt",
"dupn_01.tc.tzt",
# NOTE: unknown primitive `Failed`
"failwith_00.tc.tzt",
"failwith_00.tzt",
"get_00.tc.tzt",
"get_map_00.tc.tzt",
"gt_00.tc.tzt",
"if_00.tc.tzt",
"if_01.tc.tzt",
"ifcons_00.tc.tzt",
"ifleft_00.tc.tzt",
"ifnone_00.tc.tzt",
"int_00.tc.tzt",
"iter_00.tc.tzt",
"loop_00.tc.tzt",
"loop_01.tc.tzt",
# NOTE: unknown primitive `GeneralOverflow`
"lsl_01.tzt",
# NOTE: unknown primitive `GeneralOverflow`
"lsr_01.tzt",
"macro_pack",
# NOTE: unknown primitive `MutezOverflow`
"mul_mutez-nat_01.tzt",
# NOTE: unknown primitive `MutezOverflow
# NOTE: unknown primitive `MutezOverflow`
"mul_nat-mutez_01.tzt",
"not_bytes_00.tzt",
"not_bytes_01.tzt",
"not_bytes_02.tzt",
"or_bytes-bytes_00.tzt",
"or_bytes-bytes_01.tzt",
"or_bytes-bytes_02.tzt",
"or_bytes-bytes_03.tzt",
"pack_key_03.tzt",
"pack_lambda_comb_pairs.tzt",
"pack_operation_00.tc.tzt",
"pack_signature_03.tzt",
"pair_00.tc.tzt",
"push_00.tc.tzt",
# NOTE: parameter type is not defined
"self_00.tzt",
"self_in_lambda.tc.tzt",
# NOTE: failed to parse expression LexToken(_,'_',1,199)
"setdelegate_00.tc.tzt",
"setdelegate_00.tzt",
# NOTE: ('SLICE', 'string is empty')
"slice_string_05.tzt",
"some_00.tc.tzt",
# NOTE: unknown primitive `MutezUnderflow`
"sub_mutez-mutez_01.tzt",
"swap_00.tc.tzt",
"swap_01.tc.tzt",
# NOTE: failed to parse expression LexToken(_,'_',1,238)
"transfertokens_00.tc.tzt",
"transfertokens_00.tzt",
"transfertokens_01.tzt",
"unpair_00.tc.tzt",
"update_00.tc.tzt",
"update_bigmapstringstring_01.tzt",
"update_bigmapstringstring_02.tzt",
"update_bigmapstringstring_03.tzt",
"update_bigmapstringstring_04.tzt",
"update_bigmapstringstring_05.tzt",
"update_bigmapstringstring_06.tzt",
"update_bigmapstringstring_07.tzt",
"xor_bytes-bytes_00.tzt",
"xor_bytes-bytes_01.tzt",
"xor_bytes-bytes_02.tzt",
"xor_bytes-bytes_03.tzt",
]

def test_tzt(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_michelson/test_repl/tzt
Submodule tzt updated from d9b32d to 177079

0 comments on commit 2b410cc

Please sign in to comment.