def test_smart_storage_with_defaults(): storage = SmartProgressStorage() assert isinstance(storage.storages[0], AnnotationsProgressStorage) assert isinstance(storage.storages[1], StatusProgressStorage) assert storage.storages[0].prefix == 'kopf.zalando.org' assert storage.storages[1].field == ('status', 'kopf', 'progress') assert storage.storages[1].touch_field == ('status', 'kopf', 'dummy')
def test_smart_storage_with_prefix(): storage = SmartProgressStorage(prefix='my-operator.my-company.com') assert isinstance(storage.storages[0], AnnotationsProgressStorage) assert isinstance(storage.storages[1], StatusProgressStorage) assert storage.storages[0].prefix == 'my-operator.my-company.com' assert storage.storages[1].field == ('status', 'kopf', 'progress') assert storage.storages[1].touch_field == ('status', 'kopf', 'dummy')
def test_smart_storage_with_field(): storage = SmartProgressStorage(field='status.my-operator', touch_field='status.my-dummy') assert isinstance(storage.storages[0], AnnotationsProgressStorage) assert isinstance(storage.storages[1], StatusProgressStorage) assert storage.storages[0].prefix == 'kopf.zalando.org' assert storage.storages[1].field == ('status', 'my-operator') assert storage.storages[1].touch_field == ('status', 'my-dummy')
def test_smart_storage_with_name(): storage = SmartProgressStorage(name='my-operator') assert isinstance(storage.storages[0], AnnotationsProgressStorage) assert isinstance(storage.storages[1], StatusProgressStorage) assert storage.storages[0].prefix == 'kopf.zalando.org' assert storage.storages[1].field == ('status', 'my-operator', 'progress')