コード例 #1
0
    def test_do_members_replace_dry_run_true(self):
        class Fake():
            def __init__(self):
                self.dry_run = True
                self.can_share = True
                self.image_id = 'fake_id'
                self.member_id = 'test'

        gc = client.Client('1', 'http://is.invalid')
        test_shell.do_members_replace(gc, Fake())
コード例 #2
0
    def test_do_members_replace_dry_run_true(self):
        class Fake():
            def __init__(self):
                self.dry_run = True
                self.can_share = True
                self.image_id = 'fake_id'
                self.member_id = 'test'

        gc = client.Client('1', 'http://is.invalid')
        test_shell.do_members_replace(gc, Fake())
コード例 #3
0
    def test_do_members_replace_dry_run_false(self):
        class Fake():
            def __init__(self):
                self.dry_run = False
                self.can_share = True
                self.image_id = 'fake_id'
                self.member_id = 'test'

        gc = client.Client('1', 'http://is.invalid')

        with mock.patch.object(gc.image_members, 'list') as mocked_list:
            mocked_list.return_value = []
            with mock.patch.object(gc.image_members, 'create'):
                test_shell.do_members_replace(gc, Fake())
コード例 #4
0
    def test_do_members_replace_dry_run_false(self):
        class Fake():
            def __init__(self):
                self.dry_run = False
                self.can_share = True
                self.image_id = 'fake_id'
                self.member_id = 'test'

        gc = client.Client('1', 'http://is.invalid')

        with mock.patch.object(gc.image_members, 'list') as mocked_list:
            mocked_list.return_value = []
            with mock.patch.object(gc.image_members, 'create'):
                test_shell.do_members_replace(gc, Fake())