templates.test_keywords
1import smartpy as sp 2 3 4@sp.module 5def main(): 6 class C(sp.Contract): 7 def __init__(self, x, y): 8 self.data.x = x 9 self.data.y = y 10 11 12@sp.add_test() 13def test(): 14 s = sp.test_scenario("Keywords", main) 15 c = main.C(y=42, x="abc") 16 s += c 17 s.verify(c.data.x == "abc") 18 s.verify(c.data.y == 42)