How to use the tableaudocumentapi.Connection function in tableaudocumentapi

To help you get started, we’ve selected a few tableaudocumentapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tableau / document-api-python / test / bvt.py View on Github external
def test_bad_dbclass_rasies_attribute_error(self):
        conn = Connection(self.connection)
        conn.dbclass = 'sqlserver'
        self.assertEqual(conn.dbclass, 'sqlserver')
        with self.assertRaises(AttributeError):
            conn.dbclass = 'NotReal'
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_delete_port_from_connection(self):
        conn = Connection(self.connection)
        conn.port = None
        self.assertEqual(conn.port, None)
        self.assertIsNone(conn._connectionXML.get('port'))
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_extract_federated_connections(self):
        parser = ConnectionParser(ET.parse(TABLEAU_10_TDS), '10.0')
        connections = parser.get_connections()
        self.assertIsInstance(connections, list)
        self.assertIsInstance(connections[0], Connection)
        self.assertEqual(connections[0].dbname, 'TestV1')
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_delete_port_from_connection(self):
        conn = Connection(self.connection)
        conn.port = None
        self.assertEqual(conn.port, None)
        self.assertIsNone(conn._connectionXML.get('port'))
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_read_attributes_from_connection(self):
        conn = Connection(self.connection)
        self.assertEqual(conn.dbname, 'TestV1')
        self.assertEqual(conn.username, '')
        self.assertEqual(conn.server, 'mssql2012')
        self.assertEqual(conn.dbclass, 'sqlserver')
        self.assertEqual(conn.authentication, 'sspi')
        self.assertEqual(conn.port, '1433')
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_extract_federated_connections(self):
        parser = ConnectionParser(ET.parse(TABLEAU_10_TDS), '10.0')
        connections = parser.get_connections()
        self.assertIsInstance(connections, list)
        self.assertIsInstance(connections[0], Connection)
        self.assertEqual(connections[0].dbname, 'TestV1')
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_extract_connection(self):
        ds = Datasource.from_file(self.tds_file.name)
        self.assertIsInstance(ds.connections[0], Connection)
        self.assertIsInstance(ds.connections, list)
github tableau / document-api-python / test / bvt.py View on Github external
def test_can_delete_initial_sql_from_connection(self):
        conn = Connection(self.connection)
        conn.initial_sql = None
        self.assertEqual(conn.initial_sql, None)
        self.assertIsNone(conn._connectionXML.get('initial_sql'))
github tableau / document-api-python / tableaudocumentapi / datasource.py View on Github external
def _extract_federated_connections(self):
        connections = list(map(Connection, self._dsxml.findall('.//named-connections/named-connection/*')))
        # 'sqlproxy' connections (Tableau Server Connections) are not embedded into named-connection elements
        # extract them manually for now
        connections.extend(map(Connection, self._dsxml.findall("./connection[@class='sqlproxy']")))
        return connections