#NEWLINE# def test_SliceWriteCheck( setup_sim ) : #NEWLINE# #INDENT# import pytest #NEWLINE# model = SliceWriteCheck ( 16 ) #NEWLINE# ( model , sim ) = setup_sim ( model ) #NEWLINE# assert ( model . out == 0 ) #NEWLINE# model . in_ . n = 8 #NEWLINE# sim . cycle ( ) #NEWLINE# assert ( model . out == 8 ) #NEWLINE# model . in_ [ 0 ] . n = 1 #NEWLINE# sim . cycle ( ) #NEWLINE# assert ( model . out == 9 ) #NEWLINE# model . in_ [ 4 : 8 ] . n = 9 #NEWLINE# sim . cycle ( ) #NEWLINE# assert ( model . out == 153 ) #NEWLINE# model . in_ . n = 8 #NEWLINE# sim . cycle ( ) #NEWLINE# assert ( model . out == 8 ) #NEWLINE# model . in_ . n [ 0 ] = 1 #NEWLINE# sim . cycle ( ) #NEWLINE# with pytest . raises ( AssertionError ) : #NEWLINE# #INDENT# assert ( model . out == 9 ) #NEWLINE# #UNINDENT# model . in_ . n [ 4 : 8 ] = 9 #NEWLINE# sim . cycle ( ) #NEWLINE# with pytest . raises ( AssertionError ) : #NEWLINE# #INDENT# assert ( model . out == 153 )