def test_all_parameter(self):
     param = PostgreSQLCopyToParameter(
         {
             'postgresql_component_key': self._component,
             'sql_file_name': self._sql_file_name,
             'csv_file_name': self._csv_file_name,
             'delimiter': '\t',
             'null_str': '<NL>',
             'header': False,
             'quote': ' ',
             'escape': '\t',
             'gzip': True,
             'force_quote_list': ['*'],
             'encoding': 'sjis'
         }
     )
     self.assertEqual(self._component, param.postgresql_component_key.get())
     self.assertEqual(self._sql_file_name, param.sql_file_name.get())
     self.assertEqual(self._csv_file_name, param.csv_file_name.get())
     self.assertEqual('\t', param.delimiter.get())
     self.assertEqual('<NL>', param.null_str.get())
     self.assertEqual(False, param.header.get())
     self.assertEqual(' ', param.quote.get())
     self.assertEqual('\t', param.escape.get())
     self.assertEqual(True, param.gzip.get())
     self.assertEqual(['*'], param.force_quote_list.get())
     self.assertEqual('sjis', param.encoding.get())
 def test_csv_file_name_not_set(self):
     with self.assertRaises(SubModuleParameterError):
         PostgreSQLCopyToParameter(
             {
                 'postgresql_component_key': self._component,
                 'sql_file_name': self._sql_file_name
             }
         )
 def test_gzip_not_bool(self):
     with self.assertRaises(SubModuleParameterError):
         PostgreSQLCopyToParameter(
             {
                 'postgresql_component_key': self._component,
                 'sql_file_name': self._sql_file_name,
                 'csv_file_name': self._csv_file_name,
                 'gzip': 'gzip'
             }
         )
 def test_force_quote_list_not_list(self):
     with self.assertRaises(SubModuleParameterError):
         PostgreSQLCopyToParameter(
             {
                 'postgresql_component_key': self._component,
                 'sql_file_name': self._sql_file_name,
                 'csv_file_name': self._csv_file_name,
                 'force_quote_list': '*'
             }
         )
 def test_must_parameter(self):
     param = PostgreSQLCopyToParameter(
         {
          'postgresql_component_key': self._component,
          'sql_file_name': self._sql_file_name,
          'csv_file_name': self._csv_file_name
         }
     )
     self.assertEqual(self._component, param.postgresql_component_key.get())
     self.assertEqual(self._sql_file_name, param.sql_file_name.get())
     self.assertEqual(self._csv_file_name, param.csv_file_name.get())
     self.assertEqual(',', param.delimiter.get())
     self.assertEqual(None, param.null_str.get())
     self.assertEqual(True, param.header.get())
     self.assertEqual('"', param.quote.get())
     self.assertEqual('"', param.escape.get())
     self.assertEqual(False, param.gzip.get())
     self.assertEqual(None, param.force_quote_list.get())
     self.assertEqual('utf-8', param.encoding.get())