Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1import json 

2import os 

3import sys 

4 

5import pytest 

6 

7from sdc_etl_libs.database_helpers.ODBCNetsuite import ODBCNetsuite 

8from sdc_etl_libs.sdc_data_schema.schema_toolbox import SchemaToolbox 

9from sdc_etl_libs.sdc_file_helpers.SDCFileFactory import SDCFileFactory 

10 

11data_schema_1 = json.loads( 

12 open(os.path.dirname(os.path.abspath(__file__)) + "/test-netsuite-odbc-salesorder.json").read()) 

13ep_schema_1 = SchemaToolbox.get_endpoint_data_from_schema(data_schema_1, "main_source", validate_=True) 

14 

15 

16@pytest.mark.skip(reason="CData ODBC driver for Netsuite has not installed yet") 

17def test_connection(): 

18 netsuite_connection = ODBCNetsuite(data_schema_1, ep_schema_1) 

19 netsuite_connection.connect() 

20 netsuite_connection.execute_query("SELECT InternalId FROM SalesOrder limit 2;", return_results_=True) 

21 dataset = netsuite_connection.get_results() 

22 assert len(next(dataset)) == 1