Skip to content

Commit cdb4052

Browse files
committed
nose2pytest test_external
1 parent 6046b81 commit cdb4052

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

tests/test_external.py

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def test_external_put():
3535
hash2 = ext.put(pack(np.random.randn(4, 3, 2)))
3636

3737
fetched_hashes = ext.fetch("hash")
38-
assert_true(all(hash in fetched_hashes for hash in (hash1, hash2)))
39-
assert_equal(len(ext), initial_length + 1 + extra)
38+
assert all(hash in fetched_hashes for hash in (hash1, hash2))
39+
assert len(ext) == initial_length + 1 + extra
4040

4141
output_ = unpack(ext.get(hash1))
4242
assert_array_equal(input_, output_)
@@ -54,58 +54,42 @@ def test_s3_leading_slash(index=100, store="share"):
5454
id = index
5555
dj.config["stores"][store]["location"] = "leading/slash/test"
5656
SimpleRemote.insert([{"simple": id, "item": value}])
57-
assert_true(
58-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
59-
)
57+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
6058

6159
id = index + 1
6260
dj.config["stores"][store]["location"] = "/leading/slash/test"
6361
SimpleRemote.insert([{"simple": id, "item": value}])
64-
assert_true(
65-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
66-
)
62+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
6763

6864
id = index + 2
6965
dj.config["stores"][store]["location"] = "leading\\slash\\test"
7066
SimpleRemote.insert([{"simple": id, "item": value}])
71-
assert_true(
72-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
73-
)
67+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
7468

7569
id = index + 3
7670
dj.config["stores"][store]["location"] = "f:\\leading\\slash\\test"
7771
SimpleRemote.insert([{"simple": id, "item": value}])
78-
assert_true(
79-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
80-
)
72+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
8173

8274
id = index + 4
8375
dj.config["stores"][store]["location"] = "f:\\leading/slash\\test"
8476
SimpleRemote.insert([{"simple": id, "item": value}])
85-
assert_true(
86-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
87-
)
77+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
8878

8979
id = index + 5
9080
dj.config["stores"][store]["location"] = "/"
9181
SimpleRemote.insert([{"simple": id, "item": value}])
92-
assert_true(
93-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
94-
)
82+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
9583

9684
id = index + 6
9785
dj.config["stores"][store]["location"] = "C:\\"
9886
SimpleRemote.insert([{"simple": id, "item": value}])
99-
assert_true(
100-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
101-
)
87+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
10288

10389
id = index + 7
10490
dj.config["stores"][store]["location"] = ""
10591
SimpleRemote.insert([{"simple": id, "item": value}])
106-
assert_true(
107-
np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
108-
)
92+
assert np.array_equal(value, (SimpleRemote & "simple={}".format(id)).fetch1("item"))
10993

11094
dj.config["stores"][store]["location"] = oldConfig
11195

0 commit comments

Comments
 (0)