def test_do_member_add_error(self):
        class FakeClient():
            def __init__(self):
                self.image_members = ImageMembers()

        class FakeImage1():
            def __init__(self):
                self.member_id = 'test'
                self.fields = ["name", "id", "filter"]
                self.dry_run = True
                self.image_id = 'fake_image_id'
                self.can_share = True

            def delete(self):
                pass

            def get(self, id):
                return FakeImage1()

        class ImageMembers():
            def __init__(self):
                self.member_id = 'test'
                self.can_share = True

            def list(self, image):
                return [ImageMembers(), ImageMembers()]

        test_shell.do_member_add(FakeClient(), FakeImage1())
    def test_do_member_replace(self):
        class FakeClient():
            def __init__(self):
                self.image_members = ImageMembers()

        class ImageMembers():
            def __init__(self):
                self.member_id = 'test'
                self.can_share = True
                self.dry_run = True
                self.image_id = "fake_image_id"

            def list(self, image):
                return [ImageMembers(), ImageMembers()]

        test_shell.do_member_add(FakeClient(), ImageMembers())