{"action":"created","issue":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/479","repository_url":"https://api.github.com/repos/jmcnamara/XlsxWriter","labels_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/479/labels{/name}","comments_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/479/comments","events_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/479/events","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/479","id":270681948,"number":479,"title":"Feature Request: Allow compare files helper function to be used publicly","user":{"login":"bellawoo","id":9085474,"avatar_url":"https://avatars1.githubusercontent.com/u/9085474?v=4","gravatar_id":"","url":"https://api.github.com/users/bellawoo","html_url":"https://github.com/bellawoo","followers_url":"https://api.github.com/users/bellawoo/followers","following_url":"https://api.github.com/users/bellawoo/following{/other_user}","gists_url":"https://api.github.com/users/bellawoo/gists{/gist_id}","starred_url":"https://api.github.com/users/bellawoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bellawoo/subscriptions","organizations_url":"https://api.github.com/users/bellawoo/orgs","repos_url":"https://api.github.com/users/bellawoo/repos","events_url":"https://api.github.com/users/bellawoo/events{/privacy}","received_events_url":"https://api.github.com/users/bellawoo/received_events","type":"User","site_admin":false},"labels":[{"id":32823738,"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/labels/feature%20request","name":"feature request","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars3.githubusercontent.com/u/94267?v=4","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"assignees":[{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars3.githubusercontent.com/u/94267?v=4","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-11-02T14:50:29Z","updated_at":"2017-11-03T09:11:18Z","closed_at":null,"author_association":"NONE","body":"In using XlsxWriter to create Excel files, we would like to write unit tests to confirm that the XlsxWriter generated file matches our expectations. Using diff or filecmp returns False, even when both the testing and expected files are generated using XlsxWriter. XlsxWriter currently has a helper function _compare_xlsx_files to achieve this in its own tests. It would be helpful to those using this module to be able to import that function for testing within our own applications.\r\n\r\nCurrently, I'm using a workaround of a wrapper around the internal function in a [forked repo](https://github.com/Dharma-Platform/XlsxWriter/commit/26c19a2594c6b15afc4051e4fc234010a60af957)."},"comment":{"url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/comments/341651682","html_url":"https://github.com/jmcnamara/XlsxWriter/issues/479#issuecomment-341651682","issue_url":"https://api.github.com/repos/jmcnamara/XlsxWriter/issues/479","id":341651682,"user":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars3.githubusercontent.com/u/94267?v=4","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T09:11:18Z","updated_at":"2017-11-03T09:11:18Z","author_association":"OWNER","body":"I can certainly add that.\r\n\r\nHowever, I'm not sure how generally useful the  `_compare_xlsx_files()` method would be. It checks for equality rather than equivalence. So the following Excel files would be equivalent but not equal due to the order that the shared strings are stored in (Note, this is the same for Excel generated files):\r\n\r\n```python\r\nimport xlsxwriter\r\n\r\n# Example 1.\r\nworkbook = xlsxwriter.Workbook('demo1.xlsx')\r\nworksheet = workbook.add_worksheet()\r\n\r\nworksheet.write('A1', 'Foo')\r\nworksheet.write('A2', 'Bar')\r\n\r\nworkbook.close()\r\n\r\n# Example 2.\r\nworkbook = xlsxwriter.Workbook('demo2.xlsx')\r\nworksheet = workbook.add_worksheet()\r\n\r\nworksheet.write('A1', 'Bar')\r\nworksheet.write('A2', 'Foo')\r\n\r\nworkbook.close()\r\n``` "}}
{"actor":{"display_login":"jmcnamara"}}