Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic TWBX Support #43

Merged
merged 6 commits into from
Jun 30, 2016
Merged

Basic TWBX Support #43

merged 6 commits into from
Jun 30, 2016

Conversation

t8y8
Copy link
Contributor

@t8y8 t8y8 commented Jun 29, 2016

  • 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


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'
Copy link
Contributor

@graysonarts graysonarts Jun 29, 2016

Choose a reason for hiding this comment

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

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
Contributor Author

Choose a reason for hiding this comment

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

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 graysonarts merged commit 23e897a into tableau:development Jun 30, 2016
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