def test_get_first_record(self, mock_keyring_get_password: MagicMock,
                           mock_user_config_dir: MagicMock):
     persons = [
         Person(user_name='test',
                first_name='first',
                last_name='last',
                team='test-team',
                employment_term='fulltime',
                age=10,
                start_date=datetime.datetime(2020, 2, 2))
     ]
     self.add_data(persons)
     with patch(
             'pypandas_sql.dbconnector.redshift_connector.RedshiftConnector.get_connection',
             return_value=self.get_connection()):
         query_engine = RedshiftQueryEngine()
         mock_user_config_dir.assert_called_once_with('pypandasql')
         mock_keyring_get_password.assert_called_once_with(
             'pypandasql-redshift', 'test')
         out_list = query_engine.get_first_record(
             sql='select * from test_people', schema='test-schema')
         self.assertEqual(out_list[0], 'test')
         self.assertEqual(out_list[1], 'first')
         self.assertEqual(out_list[2], 'last')
         self.assertEqual(out_list[3], 'test-team')
         self.assertEqual(out_list[4], 'fulltime')
         self.assertEqual(out_list[5], '2020-02-02 00:00:00.000000')
         self.assertEqual(out_list[6], 10)
 def test_get_records_empty_sql(self, mock_keyring_get_password: MagicMock,
                                mock_user_config_dir: MagicMock):
     persons = [
         Person(user_name='test',
                first_name='first',
                last_name='last',
                team='test-team',
                employment_term='fulltime',
                age=10,
                start_date=datetime.datetime(2020, 2, 2))
     ]
     self.add_data(persons)
     query_engine = RedshiftQueryEngine()
     mock_user_config_dir.assert_called_once_with('pypandasql')
     mock_keyring_get_password.assert_called_once_with(
         'pypandasql-redshift', 'test')
     with self.assertRaises(AssertionError):
         query_engine.get_records(sql='', schema='test-schema')