<s> import os <EOL> from datetime import date <EOL> from stdnet import odm , InvalidTransaction <EOL> from stdnet . utils import test , encoders , zip <EOL> from stdnet . utils . populate import populate <EOL> from . base import StructMixin <EOL> class TestNumberArray ( StructMixin , test . TestCase ) : <EOL> structure = odm . NumberArray <EOL> name = '<STR_LIT>' <EOL> def create_one ( self ) : <EOL> a = self . structure ( ) <EOL> return a . push_back ( <NUM_LIT> ) . push_back ( - <NUM_LIT> ) <EOL> def testSizeResize ( self ) : <EOL> a = yield self . not_empty ( ) <EOL> yield self . async . assertEqual ( a . size ( ) , <NUM_LIT:2> ) <EOL> yield self . async . assertEqual ( len ( a ) , <NUM_LIT:2> ) <EOL> yield self . async . assertEqual ( a . resize ( <NUM_LIT:10> ) , <NUM_LIT:10> ) <EOL> data = yield a . items ( ) <EOL> self . assertEqual ( len ( data ) , <NUM_LIT:10> ) <EOL> self . assertAlmostEqual ( data [ <NUM_LIT:0> ] , <NUM_LIT> ) <EOL> self . assertAlmostEqual ( data [ <NUM_LIT:1> ] , - <NUM_LIT> ) <EOL> for v in data [ <NUM_LIT:2> : ] : <EOL> self . assertNotEqual ( v , v ) <EOL> def testSetGet ( self ) : <EOL> a = yield self . not_empty ( ) <EOL> yield self . async . assertEqual ( a . size ( ) , <NUM_LIT:2> ) <EOL> value = yield a [ <NUM_LIT:1> ] <EOL> self . assertAlmostEqual ( value , - <NUM_LIT> ) </s>
