FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Basic TWBX Support by t8y8 · Pull Request #43 · tableau/document-api-python · GitHub

Basic TWBX Support - #43

Merged
graysonarts merged 6 commits into
tableau:developmentfrom
t8y8:zip-support
Jun 30, 2016
Merged

Basic TWBX Support#43
graysonarts merged 6 commits into
tableau:developmentfrom
t8y8:zip-support

Conversation

t8y8 commented Jun 29, 2016

Copy link
Copy Markdown
Contributor
  • Support for read/write of connections in TWBX files
  • New TWBX tests
  • Moved test assets into a new folder and read from the gold copies for tests.
    -- Yay no more embedded xml!

Tests pass on OS X py27 and py35

Replaces #13

Comment thread test/bvt.py Outdated
# TODO: Move the XML into external files and load them when needed

TABLEAU_93_WORKBOOK = '''<?xml version='1.0' encoding='utf-8' ?><workbook source-build='9.3.1 (9300.16.0510.0100)' source-platform='mac' version='9.3' xmlns:user='http://www.tableausoftware.com/xml/user'><datasources><datasource caption='xy (TestV1)' inline='true' name='sqlserver.17u3bqc16tjtxn14e2hxh19tyvpo' version='9.3'><connection authentication='sspi' class='sqlserver' dbname='TestV1' odbc-native-protocol='yes' one-time-sql='' server='mssql2012.test.tsi.lan' username=''></connection></datasource></datasources></workbook>''' # noqa
TABLEAU_93_TWB = 'test/assets/TABLEAU_93_TWB.twb'

graysonarts Jun 29, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You should use this pattern when accessing files in test cases, so it's always based on a specific path:

os.path.join(
  os.path.dirname(__file__),
  'test', 'asserts', filename
))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, that's less fragile.

It looks like it would be:

os.path.join( os.path.dirname(__file__), 'asserts', filename) )

No 'tests' directory, since bvt.py is already located in test.

Since os.path.dirname(__file__) is duplicated, how about:

`TEST_DIR = os.path.dirname(file)

TABLEAU_93_TWB = os.path.join(TEST_DIR, 'assets', 'TABLEAU_93_TWB.twb`
... etc

graysonarts merged commit 23e897a into tableau:development Jun 30, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL