From 9cc1bd75ad17f5fa4c96dc3045494833f7943b27 2013-11-14 01:14:25
From: Peter Davis <peter.davis8@gmail.com>
Date: 2013-11-14 01:14:25
Subject: [PATCH] Add tests for filter

---

diff --git a/IPython/nbconvert/filters/tests/test_latex.py b/IPython/nbconvert/filters/tests/test_latex.py
index a66d0f5..9ca87cb 100644
--- a/IPython/nbconvert/filters/tests/test_latex.py
+++ b/IPython/nbconvert/filters/tests/test_latex.py
@@ -42,4 +42,19 @@ class TestLatex(TestsBase):
         """Try to remove latex from string"""
         self.assertEqual(escape_latex(test), result)
 
+    def test_strip_url_static_file_prefix(self):
+        tests = [
+            ('hello!', 'hello!'),
+            ('hello![caption]', 'hello![caption]'),
+            ('hello![caption](/url/location.gif)', 'hello![caption](/url/location.gif)'),
+            ('hello![caption](url/location.gif)', 'hello![caption](url/location.gif)'),
+            ('hello![caption](url/location.gif)', 'hello![caption](url/location.gif)'),
+            ('hello![caption](files/url/location.gif)', 'hello![caption](url/location.gif)'),
+            ('hello![caption](/files/url/location.gif)', 'hello![caption](url/location.gif)'),
+        ]
+        
+        for test in tests:
+            self._test_strip_url_static_file_prefix(test[0], test[1])
 
+    def _test_strip_url_static_file_prefix(self, test, result):
+        self.assertEqual(strip_url_static_file_prefix(test), result)