Exemple #1
0
def test_empty_tasklist():
	parser = LogParser()
	parser.read(StringIO(INITIAL_GAME))
	parser.flush()

	ts = datetime.now()
	msg = "id=4 Player=The Innkeeper TaskList=1 ChoiceType=GENERAL CountMin=1 CountMax=1"
	choices = parser.handle_entity_choices(ts, msg)
	assert choices
	assert choices.id == 4
	assert choices.player == "The Innkeeper"
	assert choices.tasklist == 1
	assert choices.type == ChoiceType.GENERAL
	assert choices.min == 1
	assert choices.max == 1

	# Test empty tasklist
	msg = "id=4 Player=The Innkeeper TaskList= ChoiceType=GENERAL CountMin=1 CountMax=1"
	choices = parser.handle_entity_choices(ts, msg)
	assert choices.tasklist is None
def test_empty_tasklist():
	parser = LogParser()
	parser.read(StringIO(INITIAL_GAME))
	parser.flush()

	ts = datetime.now()
	msg = "id=4 Player=The Innkeeper TaskList=1 ChoiceType=GENERAL CountMin=1 CountMax=1"
	choices = parser.handle_entity_choices(ts, msg)
	assert choices
	assert choices.id == 4
	assert choices.player.name == "The Innkeeper"
	assert choices.tasklist == 1
	assert choices.type == ChoiceType.GENERAL
	assert choices.min == 1
	assert choices.max == 1

	# Test empty tasklist
	msg = "id=4 Player=The Innkeeper TaskList= ChoiceType=GENERAL CountMin=1 CountMax=1"
	choices = parser.handle_entity_choices(ts, msg)
	assert choices.tasklist is None