Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. [✓] 10:53:05(1501091585) [711791c79b] (tensorflow-nightly-20170726)
  2. wchargin@wchargin:~/git/tensorboard
  3. $ git status
  4. HEAD detached at origin/master
  5. Changes not staged for commit:
  6. (use "git add <file>..." to update what will be committed)
  7. (use "git checkout -- <file>..." to discard changes in working directory)
  8.  
  9. modified: tensorboard/plugins/text/text_plugin_test.py
  10.  
  11. no changes added to commit (use "git add" and/or "git commit -a")
  12.  
  13. [✓] 10:53:07(1501091587) [711791c79b] (tensorflow-nightly-20170726)
  14. wchargin@wchargin:~/git/tensorboard
  15. $ git diff
  16. diff --git a/tensorboard/plugins/text/text_plugin_test.py b/tensorboard/plugins/text/text_plugin_test.py
  17. index d8967f6..fa2b5e4 100644
  18. --- a/tensorboard/plugins/text/text_plugin_test.py
  19. +++ b/tensorboard/plugins/text/text_plugin_test.py
  20. @@ -353,6 +353,40 @@ class TextPluginTest(tf.test.TestCase):
  21. scalar_expected = '<p>foo</p>'
  22. self.assertEqual(convert(scalar), scalar_expected)
  23.  
  24. + table = textwrap.dedent("""\
  25. + An | Example | Table
  26. + --- | --- | ---
  27. + A | B | C
  28. + 1 | 2 | 3
  29. + """)
  30. +
  31. + table_converted = textwrap.dedent("""\
  32. + <table>
  33. + <thead>
  34. + <tr>
  35. + <th>An</th>
  36. + <th>Example</th>
  37. + <th>Table</th>
  38. + </tr>
  39. + </thead>
  40. + <tbody>
  41. + <tr>
  42. + <td>A</td>
  43. + <td>B</td>
  44. + <td>C</td>
  45. + </tr>
  46. + <tr>
  47. + <td>1</td>
  48. + <td>2</td>
  49. + <td>3</td>
  50. + </tr>
  51. + </tbody>
  52. + </table>""")
  53. +
  54. + scalar = np.array(table)
  55. + scalar_expected = table_converted
  56. + self.assertEqual(convert(scalar), scalar_expected)
  57. +
  58. vector = np.array(['foo', 'bar'])
  59. vector_expected = textwrap.dedent("""\
  60. <table>
  61.  
  62. [✓] 10:53:08(1501091588) [711791c79b] (tensorflow-nightly-20170726)
  63. wchargin@wchargin:~/git/tensorboard
  64. $ bazel test tensorboard/plugins/text:text_plugin_test
  65. INFO: Found 1 test target...
  66. Target //tensorboard/plugins/text:text_plugin_test up-to-date:
  67. bazel-bin/tensorboard/plugins/text/text_plugin_test
  68. INFO: Elapsed time: 1.695s, Critical Path: 1.42s
  69. //tensorboard/plugins/text:text_plugin_test PASSED in 1.4s
  70.  
  71. Executed 1 out of 1 test: 1 test passes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement