1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
1
import os
5
2
6
3
import pyexcel as p
7
4
from pyexcel_io import get_data , save_data
5
+ from pyexcel_io .exceptions import NoSupportingPluginFound
8
6
9
7
from nose import SkipTest
10
- from nose .tools import eq_
8
+ from nose .tools import eq_ , raises
11
9
12
10
IN_TRAVIS = "TRAVIS" in os .environ
13
11
@@ -41,17 +39,6 @@ def test_issue_23():
41
39
eq_ (data ["issue23.csv" ], expected )
42
40
43
41
44
- # def test_issue_28():
45
- # from pyexcel_io.plugins import readers
46
- # from pyexcel_io.exceptions import UpgradePlugin
47
- # expected = "Please upgrade the plugin '%s' according to "
48
- # expected += "plugin compactibility table."
49
- # try:
50
- # readers.load_me_later('pyexcel_test')
51
- # except UpgradePlugin as e:
52
- # eq_(str(e), expected % 'pyexcel_test')
53
-
54
-
55
42
def test_issue_33_34 ():
56
43
import mmap
57
44
@@ -64,7 +51,7 @@ def test_issue_33_34():
64
51
65
52
66
53
def test_issue_30_utf8_BOM_header ():
67
- content = [[u "人有悲歡離合" , u "月有陰晴圓缺" ]]
54
+ content = [["人有悲歡離合" , "月有陰晴圓缺" ]]
68
55
test_file = "test-utf8-BOM.csv"
69
56
save_data (test_file , content , encoding = "utf-8-sig" , lineterminator = "\n " )
70
57
custom_encoded_content = get_data (test_file , encoding = "utf-8-sig" )
@@ -154,5 +141,10 @@ def test_pyexcel_issue_138():
154
141
os .unlink ("test.csv" )
155
142
156
143
144
+ @raises (NoSupportingPluginFound )
145
+ def test_issue_96 ():
146
+ get_data ("foo-bar-data" , file_type = "Idonotexist" )
147
+
148
+
157
149
def get_fixture (file_name ):
158
150
return os .path .join ("tests" , "fixtures" , file_name )
0 commit comments