@@ -126,6 +126,12 @@ def test_load_corpus(self):
126
126
127
127
self .assertTrue (len (corpus ))
128
128
129
+
130
+ class CorpusFilePathTestCase (TestCase ):
131
+
132
+ def setUp (self ):
133
+ self .corpus = Corpus ()
134
+
129
135
def test_load_corpus_file (self ):
130
136
"""
131
137
Test that a file path can be specified for a corpus.
@@ -158,3 +164,24 @@ def test_load_corpus_file_non_existent(self):
158
164
self .assertFalse (os .path .exists (file_path ))
159
165
with self .assertRaises (IOError ):
160
166
corpus = self .corpus .load_corpus (file_path )
167
+
168
+ def test_load_corpus_english_greetings (self ):
169
+ file_path = os .path .join (self .corpus .data_directory , 'english' , 'greetings.yml' )
170
+
171
+ corpus = self .corpus .load_corpus (file_path )
172
+
173
+ self .assertEqual (len (corpus ), 1 )
174
+
175
+ def test_load_corpus_english (self ):
176
+ file_path = os .path .join (self .corpus .data_directory , 'english' )
177
+
178
+ corpus = self .corpus .load_corpus (file_path )
179
+
180
+ self .assertGreater (len (corpus ), 1 )
181
+
182
+ def test_load_corpus_english_trailing_slash (self ):
183
+ file_path = os .path .join (self .corpus .data_directory , 'english' ) + '/'
184
+
185
+ corpus = self .corpus .load_corpus (file_path )
186
+
187
+ self .assertGreater (len (corpus ), 1 )
0 commit comments