~russo79/mnemosyne-proj/force-matplotlib-pyqt4-backend

« back to all changes in this revision

Viewing changes to mnemosyne/tests/test_filter.py

  • Committer: Peter.Bienstman at UGent
  • Date: 2014-04-14 13:24:46 UTC
  • Revision ID: peter.bienstman@ugent.be-20140414132446-xpbfu66rfdblnbev
Fix media path expansion corner case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
from mnemosyne.libmnemosyne.filters.html5_video import Html5Video
10
10
from mnemosyne.libmnemosyne.filters.html5_audio import Html5Audio
11
11
from mnemosyne.libmnemosyne.filters.RTL_handler import RTLHandler
 
12
from mnemosyne.libmnemosyne.filters.expand_paths import ExpandPaths
12
13
from mnemosyne.libmnemosyne.filters.escape_to_html import EscapeToHtml
13
14
 
14
15
class TestFilter(MnemosyneTest):
54
55
 
55
56
         assert f.run("a\nb", None, None) == "a<br>b"
56
57
         assert f.run("<latex>a\nb<\latex>", None, None) == "<latex>a\nb<\latex>"
 
58
         
 
59
    def test_expand_paths(self):
57
60
 
 
61
        f = ExpandPaths(self.mnemosyne.component_manager)
 
62
         
 
63
        assert "media" not in \
 
64
               f.run("""data=trainingData, method=\"rpart\"""", None, None)
 
65
        assert "media" in \
 
66
               f.run("""data=\"rpart\"""", None, None)
 
67
        assert "media" in \
 
68
               f.run("""data= \"rpart\"""", None, None)        
 
69
        assert "media" not in \
 
70
               f.run("""Application data = \"rpart\"""", None, None) 
 
71
        
58
72
    def test_RTL_handler(self):
59
73
 
60
74
        f = RTLHandler(self.mnemosyne.component_manager)