Skip to content

Commit 0c61168

Browse files
committed
Merge pull request #11093 from terrytangyuan/tests
TST: More thorough test to check correctness of to_html_unicode
2 parents 2102b68 + 82e2272 commit 0c61168

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/tests/test_format.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,12 @@ def test_to_html_with_empty_string_label(self):
521521
self.assertTrue("rowspan" not in res)
522522

523523
def test_to_html_unicode(self):
524-
# it works!
525524
df = DataFrame({u('\u03c3'): np.arange(10.)})
526-
df.to_html()
525+
expected = u'<table border="1" class="dataframe">\n <thead>\n <tr style="text-align: right;">\n <th></th>\n <th>\u03c3</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>0</td>\n </tr>\n <tr>\n <th>1</th>\n <td>1</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2</td>\n </tr>\n <tr>\n <th>3</th>\n <td>3</td>\n </tr>\n <tr>\n <th>4</th>\n <td>4</td>\n </tr>\n <tr>\n <th>5</th>\n <td>5</td>\n </tr>\n <tr>\n <th>6</th>\n <td>6</td>\n </tr>\n <tr>\n <th>7</th>\n <td>7</td>\n </tr>\n <tr>\n <th>8</th>\n <td>8</td>\n </tr>\n <tr>\n <th>9</th>\n <td>9</td>\n </tr>\n </tbody>\n</table>'
526+
self.assertEqual(df.to_html(), expected)
527527
df = DataFrame({'A': [u('\u03c3')]})
528-
df.to_html()
528+
expected = u'<table border="1" class="dataframe">\n <thead>\n <tr style="text-align: right;">\n <th></th>\n <th>A</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>\u03c3</td>\n </tr>\n </tbody>\n</table>'
529+
self.assertEqual(df.to_html(), expected)
529530

530531
def test_to_html_escaped(self):
531532
a = 'str<ing1 &amp;'

0 commit comments

Comments
 (0)