Skip to content

Commit 9392959

Browse files
committed
Format with black
1 parent 012e46d commit 9392959

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

tests/conftest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,19 @@ def stores_config(tmpdir_factory):
179179
stores_config = {
180180
"raw": dict(protocol="file", location=tmpdir_factory.mktemp("raw")),
181181
"repo": dict(
182-
stage=tmpdir_factory.mktemp("repo"), protocol="file", location=tmpdir_factory.mktemp("repo")
182+
stage=tmpdir_factory.mktemp("repo"),
183+
protocol="file",
184+
location=tmpdir_factory.mktemp("repo"),
183185
),
184186
"repo-s3": dict(
185-
S3_CONN_INFO, protocol="s3", location="dj/repo", stage=tmpdir_factory.mktemp("repo-s3")
187+
S3_CONN_INFO,
188+
protocol="s3",
189+
location="dj/repo",
190+
stage=tmpdir_factory.mktemp("repo-s3"),
191+
),
192+
"local": dict(
193+
protocol="file", location=tmpdir_factory.mktemp("local"), subfolding=(1, 1)
186194
),
187-
"local": dict(protocol="file", location=tmpdir_factory.mktemp("local"), subfolding=(1, 1)),
188195
"share": dict(
189196
S3_CONN_INFO, protocol="s3", location="dj/store/repo", subfolding=(2, 4)
190197
),

tests/test_external.py

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ def test_external_put(schema_ext, mock_stores, mock_cache):
1111
"""
1212
external storage put and get and remove
1313
"""
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+
)
1517
initial_length = len(ext)
1618
input_ = np.random.randn(3, 7, 8)
1719
count = 7
@@ -30,14 +32,15 @@ def test_external_put(schema_ext, mock_stores, mock_cache):
3032

3133

3234
class TestLeadingSlash:
33-
3435
def test_s3_leading_slash(self, schema_ext, mock_stores, mock_cache, minio_client):
3536
"""
3637
s3 external storage configured with leading slash
3738
"""
3839
self._leading_slash(schema_ext, index=100, store="share")
3940

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+
):
4144
"""
4245
File external storage configured with leading slash
4346
"""
@@ -50,42 +53,58 @@ def _leading_slash(self, schema_ext, index, store):
5053
id = index
5154
dj.config["stores"][store]["location"] = "leading/slash/test"
5255
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+
)
5459

5560
id = index + 1
5661
dj.config["stores"][store]["location"] = "/leading/slash/test"
5762
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+
)
5966

6067
id = index + 2
6168
dj.config["stores"][store]["location"] = "leading\\slash\\test"
6269
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+
)
6473

6574
id = index + 3
6675
dj.config["stores"][store]["location"] = "f:\\leading\\slash\\test"
6776
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+
)
6980

7081
id = index + 4
7182
dj.config["stores"][store]["location"] = "f:\\leading/slash\\test"
7283
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+
)
7487

7588
id = index + 5
7689
dj.config["stores"][store]["location"] = "/"
7790
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+
)
7994

8095
id = index + 6
8196
dj.config["stores"][store]["location"] = "C:\\"
8297
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+
)
84101

85102
id = index + 7
86103
dj.config["stores"][store]["location"] = ""
87104
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+
)
89108

90109
dj.config["stores"][store]["location"] = oldConfig
91110

0 commit comments

Comments
 (0)