Skip to content

Commit

Permalink
check invalid arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Jul 13, 2022
1 parent f6c63de commit 7389aeb
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pyteal/ast/box_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,61 @@ def test_compile_version_and_type():

assert test_case.type_of() == test_case_type
assert not test_case.has_return()

return


def test_box_invalid_args():
with pytest.raises(pt.TealTypeError):
pt.Box.create(pt.Bytes("box"), pt.Bytes("ten"))

with pytest.raises(pt.TealTypeError):
pt.Box.create(pt.Int(0xB06), pt.Int(10))

with pytest.raises(pt.TealTypeError):
pt.Box.delete(pt.Int(0xB06))

with pytest.raises(pt.TealTypeError):
pt.Box.extract(pt.Bytes("box"), pt.Int(2), pt.Bytes("three"))

with pytest.raises(pt.TealTypeError):
pt.Box.replace(pt.Bytes("box"), pt.Int(2), pt.Int(0x570FF))

with pytest.raises(pt.TealTypeError):
pt.Box.length(pt.Int(12))

with pytest.raises(pt.TealTypeError):
pt.Box.get(pt.Int(45))

with pytest.raises(pt.TealTypeError):
pt.Box.put(pt.Bytes("box"), pt.Int(123))

return


def test_box_create_compile():
pass


def test_box_delete_compile():
pass


def test_box_extract():
pass


def test_box_replace():
pass


def test_box_length():
pass


def test_box_get():
pass


def test_box_put():
pass

0 comments on commit 7389aeb

Please sign in to comment.