Exemplo n.º 1
0
	def testGetThirstyAction(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root, "GETTHIRSTY", 4, 19)
		assert (action_occurrences == 1), "should have had GETTHIRSTY between 4 and 19, but occurred {}".format(action_occurrences)
Exemplo n.º 2
0
	def testActionOccursOnce(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"usecomputer_END",0,1000)
		assert (action_occurrences == 1), "should have had action usecomputer_END once; n times action occurred: {} [{}]".format(action_occurrences,self.xml_string)
Exemplo n.º 3
0
	def testActionJustRight(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.causal_xml,"standing_START",295,297)
		assert (action_occurrences), "should have had action at 296; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 4
0
	def testNotIncorrectAction(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"FLIPSWITCH",0,15)
		action_occurrences += xml_stuff.queryXMLForActionBetweenFrames(self.root,"A3",0,15)
		action_occurrences += xml_stuff.queryXMLForActionBetweenFrames(self.root,"A4",0,15)
		assert (not action_occurrences), "should not have had action FLIPSWITCH, A3, A4; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 5
0
	def testCorrectAction(self):
		start = 527
		end = 551
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"usecomputer_END",start,end)
		assert (action_occurrences == 1), "should have had action usecomputer_END between {} and {}; n times action occurred: {} [{}]".format(start,end,action_occurrences,self.xml_string)
Exemplo n.º 6
0
	def testCorrectAction(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"A2",0,15)
		assert (action_occurrences == 1), "should have had action A2; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 7
0
	def testActionTooLate(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"FLIPSWITCH",5,15)
		assert (not action_occurrences), "should have had no action after 5; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 8
0
	def testActionJustRight(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"FLIPSWITCH",4,6)
		assert (action_occurrences), "should have had action at 5; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 9
0
	def testActionTooEarly(self):
		#queryXMLForActionBetweenFrames(xml,action,frame1,frame2)
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"FLIPSWITCH",0,5)
		assert (not action_occurrences), "should have had no action before 5; n times action occurred: {}".format(action_occurrences)
Exemplo n.º 10
0
	def testActionAt25(self):
		action_occurrences = xml_stuff.queryXMLForActionBetweenFrames(self.root,"FLIPSWITCH",24,26)
		assert (action_occurrences), "should have had action at 25; n times action occurred: {}".format(action_occurrences)
		assert (action_occurrences < 2), "should have had action at 25; n times action occurred: {}".format(action_occurrences)