@@ -11,12 +11,11 @@ def test_find_file_in_zip_no_xml_file(self):
1111 badzip = zipfile .ZipFile (BAD_ZIP_FILE )
1212 self .assertIsNone (find_file_in_zip (badzip ))
1313
14-
1514 def test_only_find_twbs (self ):
1615 twb_from_twbx_with_cache = zipfile .ZipFile (TWBX_WITH_CACHE_FILES )
1716 self .assertEqual (find_file_in_zip (twb_from_twbx_with_cache ), 'Superstore.twb' )
18-
19- ''' These tests won't pass the python 2 check, disabling until that is removed
17+
18+
2019class Namespacing (unittest .TestCase ):
2120
2221 def assertContainsUserNamespace (self , filename ):
@@ -28,24 +27,24 @@ def assertContainsUserNamespace(self, filename):
2827 doc_beginning_excerpt += (in_file .readline ().strip ()) # first line should be xml tag
2928 lineCount += 1
3029 found = doc_beginning_excerpt .rfind ("xmlns:user=" )
31- #print(doc_beginning_excerpt[found:found+10])
30+ # print(doc_beginning_excerpt[found:found+10])
3231 self .assertRegex (doc_beginning_excerpt , "xmlns:user=" )
33-
32+
3433 def test_save_preserves_namespace_twb (self ):
35- filename = COMPLEX_TWB
34+ filename = COMPLEX_TWB
3635 self .assertContainsUserNamespace (filename )
3736 wb = Workbook (filename )
3837 new_name = 'saved-as-twb.twb'
3938 wb .save_as (new_name )
4039 self .assertContainsUserNamespace (new_name )
41- '''
4240
43- '''
41+
42+ '''
4443 def demo_bug_ns_not_preserved_if_not_used(self):
4544 filename = TABLEAU_10_TDS
4645 self.assertContainsUserNamespace(filename)
4746 wb = Datasource.from_file(filename)
48- #wb.save()
47+ #wb.save()
4948 new_name = 'saved-as-tds.tds'
5049 wb.save_as(new_name)
5150 self.assertContainsUserNamespace(new_name) <- throws
@@ -54,8 +53,6 @@ def demo_bug_ns_not_preserved_if_not_used(self):
5453 none will be added.
5554 If there is a namespace but it *is not used* in the document, it will be stripped
5655
57- Fix will be something like
56+ Fix will be something like
5857 https://stackoverflow.com/questions/41937624/elementtree-why-are-my-namespace-declarations-stripped-out
59-
6058'''
61-
0 commit comments