Commit 8d88f313 authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Merge branch 'kvamme62/sdapi-idempotent' into 'master'

Update tests after change in seismic store behavior.

See merge request !40
parents c2cd4707 e6e79e1e
Pipeline #26514 passed with stages
in 7 minutes and 41 seconds
......@@ -2532,9 +2532,10 @@ def testCloudAutoDelete():
assert fn.name[:5] == "sd://"
# Seismic drive, file not found.
with MustThrow("does not exist", RuntimeError):
with CloudFileAutoDelete("xyzzy", SDCredentials(), silent=True) as fn:
assert fn.name[:5] == "sd://"
# As of 2021-02-12 it is no longer an error to delete a non-existing file.
#with MustThrow("does not exist", RuntimeError):
with CloudFileAutoDelete("xyzzy", SDCredentials(), silent=True) as fn:
assert fn.name[:5] == "sd://"
def testReadFromCloud(filename):
with newzgy.ZgyReader(filename, iocontext=SDCredentials()) as reader, io.StringIO() as bitbucket:
......
......@@ -2286,14 +2286,27 @@ def testCloudAutoDelete():
fn.disarm()
# Seismic drive, missing credentials.
with MustThrow("service URL has not been defined", RuntimeError):
with CloudFileAutoDelete("xyzzy", None, silent=True) as fn:
assert fn.name[:5] == "sd://"
# The next test is disabled because:
#
# 1) TempFileAutoDelete.remove() now picks up the credentials from the
# environment. So there will be no error about sdurl not set.
# That change actually happened 6 months ago but:
#
# 2) The reason the test didn't start failing immediately was that
# there was a second error (file not found) that caused the code
# to decide that, yes, I got an error. Now (2021-02-12) there
# has been a change in the backend and deleting a non-existing
# file is no longer considered an error.
#with MustThrow("service URL has not been defined", RuntimeError):
# with CloudFileAutoDelete("xyzzy", None, silent=True) as fn:
# assert fn.name[:5] == "sd://"
# Seismic drive, file not found.
with MustThrow("does not exist", RuntimeError):
with CloudFileAutoDelete("xyzzy", SDCredentials(), silent=True) as fn:
assert fn.name[:5] == "sd://"
# As of 2021-02-12 it is no longer an error to delete a non-existing file.
#with MustThrow("does not exist", RuntimeError):
with CloudFileAutoDelete("xyzzy", SDCredentials(), silent=True) as fn:
assert fn.name[:5] == "sd://"
def testReadFromCloud(filename):
with newzgy.ZgyReader(filename, iocontext=SDCredentials()) as reader, io.StringIO() as bitbucket:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment