示例#1
0
文件: test_csv.py 项目: sts/interview
	def test_process_file_without_account_id_column(self):
		"""
		No idea why this fails.
		"""
		test_processor = CSV_Processor("data-test-no-account-id.csv", "output.csv", False)
		test_processor._dest = cStringIO.StringIO()
		test_processor.process_file()
		self.assertRaises(ValueError)
示例#2
0
文件: test_csv.py 项目: sts/interview
	def test_process_file_without_created_on_column(self):
		"""
		This also barfs on the SystemExit call.
		"""
		test_processor = CSV_Processor("data-test-no-created-on.csv", "output.csv", False)
		test_processor._dest = cStringIO.StringIO()
		test_processor.process_file()
		self.assertRaises(ValueError)
示例#3
0
文件: test_csv.py 项目: sts/interview
	def test_process_correctly_formatted_file(self):
		test_processor = CSV_Processor("data-test-formatted.csv", "output.csv", False)
		test_processor._dest = cStringIO.StringIO()
		test_processor.process_file()
		self.assertEqual(test_processor._dest.getvalue(), "Account ID,Created On,Status,Status Set On\n12345,2011-01-12,good,2011-01-12\n")