summaryrefslogtreecommitdiffstats
path: root/python/tests/api_files.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-07 18:16:46 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-07 18:16:46 -0700
commit75a824c0fd5697f7748f57f09e022bce97d32e0c (patch)
tree5ca687144a9deafa821c6a06a90e475e07cd405f /python/tests/api_files.py
parent778e71eb30a44dc6dce51709d2b70ba1559fc98b (diff)
downloadfatcat-75a824c0fd5697f7748f57f09e022bce97d32e0c.tar.gz
fatcat-75a824c0fd5697f7748f57f09e022bce97d32e0c.zip
test basic entity revision GET
Diffstat (limited to 'python/tests/api_files.py')
-rw-r--r--python/tests/api_files.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/python/tests/api_files.py b/python/tests/api_files.py
index 033538ef..41318e25 100644
--- a/python/tests/api_files.py
+++ b/python/tests/api_files.py
@@ -40,13 +40,23 @@ def test_file(api):
assert f1.urls == f2.urls
assert f1.release_ids == f2.release_ids
- # expansion
- # TODO: via release
- # lookup
- # TODO: via hashes; but need to generate random?
+ # get revision
+ f2_rev = api.get_file_revision(f1edit.revision)
+ assert f1edit.revision == f2_rev.revision
+ assert f2.revision == f2_rev.revision
def test_file_examples(api):
api.lookup_file(sha256='ffc1005680cb620eec4c913437dfabbf311b535cfe16cbaeb2faec1f92afc362')
f1 = api.get_file('aaaaaaaaaaaaamztaaaaaaaaam')
+ assert f1.sha256 == "ffc1005680cb620eec4c913437dfabbf311b535cfe16cbaeb2faec1f92afc362"
+
+ # TODO: no "get_file_releases" or expand thing yet...
+ #f1r = api.get_file_releases("aaaaaaaaaaaaamztaaaaaaaaam")
+ #assert f1r
+
+ # expansion (back from release)
+ #r1 = api.get_release(f1r[0].ident, expand="files")
+ #assert r1.files
+ #assert f1.ident in [f.ident for f in r1.files]