@@ -11,7 +11,9 @@ def test_external_put(schema_ext, mock_stores, mock_cache):
11
11
"""
12
12
external storage put and get and remove
13
13
"""
14
- ext = ExternalTable (schema_ext .connection , store = "raw" , database = schema_ext .database )
14
+ ext = ExternalTable (
15
+ schema_ext .connection , store = "raw" , database = schema_ext .database
16
+ )
15
17
initial_length = len (ext )
16
18
input_ = np .random .randn (3 , 7 , 8 )
17
19
count = 7
@@ -30,14 +32,15 @@ def test_external_put(schema_ext, mock_stores, mock_cache):
30
32
31
33
32
34
class TestLeadingSlash :
33
-
34
35
def test_s3_leading_slash (self , schema_ext , mock_stores , mock_cache , minio_client ):
35
36
"""
36
37
s3 external storage configured with leading slash
37
38
"""
38
39
self ._leading_slash (schema_ext , index = 100 , store = "share" )
39
40
40
- def test_file_leading_slash (self , schema_ext , mock_stores , mock_cache , minio_client ):
41
+ def test_file_leading_slash (
42
+ self , schema_ext , mock_stores , mock_cache , minio_client
43
+ ):
41
44
"""
42
45
File external storage configured with leading slash
43
46
"""
@@ -50,42 +53,58 @@ def _leading_slash(self, schema_ext, index, store):
50
53
id = index
51
54
dj .config ["stores" ][store ]["location" ] = "leading/slash/test"
52
55
SimpleRemote .insert ([{"simple" : id , "item" : value }])
53
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
56
+ assert np .array_equal (
57
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
58
+ )
54
59
55
60
id = index + 1
56
61
dj .config ["stores" ][store ]["location" ] = "/leading/slash/test"
57
62
SimpleRemote .insert ([{"simple" : id , "item" : value }])
58
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
63
+ assert np .array_equal (
64
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
65
+ )
59
66
60
67
id = index + 2
61
68
dj .config ["stores" ][store ]["location" ] = "leading\\ slash\\ test"
62
69
SimpleRemote .insert ([{"simple" : id , "item" : value }])
63
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
70
+ assert np .array_equal (
71
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
72
+ )
64
73
65
74
id = index + 3
66
75
dj .config ["stores" ][store ]["location" ] = "f:\\ leading\\ slash\\ test"
67
76
SimpleRemote .insert ([{"simple" : id , "item" : value }])
68
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
77
+ assert np .array_equal (
78
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
79
+ )
69
80
70
81
id = index + 4
71
82
dj .config ["stores" ][store ]["location" ] = "f:\\ leading/slash\\ test"
72
83
SimpleRemote .insert ([{"simple" : id , "item" : value }])
73
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
84
+ assert np .array_equal (
85
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
86
+ )
74
87
75
88
id = index + 5
76
89
dj .config ["stores" ][store ]["location" ] = "/"
77
90
SimpleRemote .insert ([{"simple" : id , "item" : value }])
78
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
91
+ assert np .array_equal (
92
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
93
+ )
79
94
80
95
id = index + 6
81
96
dj .config ["stores" ][store ]["location" ] = "C:\\ "
82
97
SimpleRemote .insert ([{"simple" : id , "item" : value }])
83
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
98
+ assert np .array_equal (
99
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
100
+ )
84
101
85
102
id = index + 7
86
103
dj .config ["stores" ][store ]["location" ] = ""
87
104
SimpleRemote .insert ([{"simple" : id , "item" : value }])
88
- assert np .array_equal (value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" ))
105
+ assert np .array_equal (
106
+ value , (SimpleRemote & "simple={}" .format (id )).fetch1 ("item" )
107
+ )
89
108
90
109
dj .config ["stores" ][store ]["location" ] = oldConfig
91
110
0 commit comments