Merge branch '1579-keep-server-in-docker' of git.clinicalfuture.com:arvados into...
[arvados.git] / sdk / python / test_keep_client.py
1 # usage example:
2 #
3 # ARVADOS_API_TOKEN=abc ARVADOS_API_HOST=arvados.local python -m unittest discover
4
5 import unittest
6 import arvados
7 import os
8
9 class KeepRWTest(unittest.TestCase):
10     def setUp(self):
11         try:
12             del os.environ['KEEP_LOCAL_STORE']
13         except KeyError:
14             pass
15     def runTest(self):
16         foo_locator = arvados.Keep.put('foo')
17         self.assertEqual(foo_locator,
18                          'acbd18db4cc2f85cedef654fccc4a4d8+3',
19                          'wrong md5 hash from Keep.put("foo"): ' + foo_locator)
20         self.assertEqual(arvados.Keep.get(foo_locator),
21                          'foo',
22                          'wrong content from Keep.get(md5("foo"))')