Ejemplo n.º 1
0
	def testEventImport(self):
        	expected_result = ('category1', [ 
                      	(20090308, 20090308, 'event1'),
                       	(20090923, 20090925, 'event2'),
                       	(20090111, 20090111, 'event3')
                ])
	    	
		actual_result = eventutils.import_events("data/eventdata.txt")
        	self.assertEqual(actual_result, expected_result)
Ejemplo n.º 2
0
	# Parse input data.

	try:
		data = utils.parse_data(input_file_path)
	except IOError, err:
		sys.exit(err)

	# Import requested events.
 	# TODO(karol): this may have to be moved from here to the plotting
	# file.

	try:
		events = { }
		if import_catastrophic_events:
			catastrophic_events = eventutils.import_events(
					"../data/wydarzenia-katastrofy-polska.txt")
			events[catastrophic_events[0]] = catastrophic_events[1]
		if import_economical_events:
			economical_events = eventutils.import_events(
					"../data/wydarzenia-ekonomiczne-polska.txt")
			events[economical_events[0]] = economical_events[1]
		if import_other_events:
			other_events = eventutils.import_events(
					"../data/wydarzenia-inne-polska.txt")
			events[other_events[0]] = other_events[1]
		if import_political_events:
			political_events = eventutils.import_events(
					"../data/wydarzenia-polityczne-polska.txt")
			events[political_events[0]] = political_events[1]
	except IOError, err:
		sys.exit(err)