| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| from unittest import TestCase |
|
|
| from nose.tools import raises |
|
|
| from minio import Minio |
| from minio.copy_conditions import CopyConditions |
|
|
|
|
| class CopyObjectTest(TestCase): |
| @raises(TypeError) |
| def test_object_is_string(self): |
| client = Minio('localhost:9000') |
| client.copy_object('hello', 12, 12) |
|
|
| @raises(ValueError) |
| def test_object_is_not_empty_string(self): |
| client = Minio('localhost:9000') |
| client.copy_object('hello', ' \t \n ', '') |
|
|
| @raises(ValueError) |
| def test_length_is_string(self): |
| client = Minio('localhost:9000') |
| client.copy_object('..hello', '1', '/testbucket/object') |
|
|
|
|
| class CopyConditionTest(TestCase): |
| @raises(ValueError) |
| def test_match_etag_is_not_empty(self): |
| conds = CopyConditions() |
| conds.set_match_etag('') |
|
|
| @raises(ValueError) |
| def test_match_etag_is_not_empty_except(self): |
| conds = CopyConditions() |
| conds.set_match_etag_except('') |
|
|
| @raises(AttributeError) |
| def test_unmodified_since(self): |
| conds = CopyConditions() |
| conds.set_unmodified_since('') |
|
|
| @raises(AttributeError) |
| def test_modified_since(self): |
| conds = CopyConditions() |
| conds.set_modified_since('') |
|
|