コード例 #1
0
 def test_list_event_with_none_resource_name(self):
     stack_id = 'teststack',
     manager = EventManager(None)
     manager._list = MagicMock()
     manager.list(stack_id)
     # Make sure url is correct.
     manager._list.assert_called_once_with('/stacks/teststack/'
                                           'events', "events")
コード例 #2
0
 def test_list_event_with_none_resource_name(self):
     stack_id = 'teststack',
     manager = EventManager(None)
     manager._list = MagicMock()
     manager.list(stack_id)
     # Make sure url is correct.
     manager._list.assert_called_once_with('/stacks/teststack/'
                                           'events', "events")
コード例 #3
0
 def test_list_event_with_unicode_resource_name(self):
     stack_id = 'teststack',
     resource_name = u'\u5de5\u4f5c'
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name)
     # Make sure url is correct.
     manager._list.assert_called_once_with('/stacks/teststack%2Fabcd1234/'
                                           'resources/%E5%B7%A5%E4%BD%9C/'
                                           'events', "events")
コード例 #4
0
 def test_list_event(self):
     stack_id = 'teststack',
     resource_name = 'testresource'
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name)
     # Make sure url is correct.
     manager._list.assert_called_once_with('/stacks/teststack%2Fabcd1234/'
                                           'resources/testresource/events',
                                           "events")
コード例 #5
0
 def test_list_event(self):
     stack_id = 'teststack',
     resource_name = 'testresource'
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name)
     # Make sure url is correct.
     manager._list.assert_called_once_with(
         '/stacks/teststack%2Fabcd1234/'
         'resources/testresource/events', "events")
コード例 #6
0
 def test_list_event_with_unicode_resource_name(self):
     stack_id = 'teststack',
     resource_name = u'\u5de5\u4f5c'
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name)
     # Make sure url is correct.
     manager._list.assert_called_once_with(
         '/stacks/teststack%2Fabcd1234/'
         'resources/%E5%B7%A5%E4%BD%9C/'
         'events', "events")
コード例 #7
0
 def test_list_event_with_kwargs(self):
     stack_id = 'teststack',
     resource_name = 'testresource'
     kwargs = {'limit': 2,
               'marker': '6d6935f4-0ae5',
               'filters': {
                   'resource_action': 'CREATE',
                   'resource_status': 'COMPLETE'
               }}
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name, **kwargs)
     # Make sure url is correct.
     manager._list.assert_called_once_with('/stacks/teststack%2Fabcd1234/'
                                           'resources/testresource/events'
                                           '?marker=6d6935f4-0ae5&limit=2'
                                           '&resource_action=CREATE&'
                                           'resource_status=COMPLETE',
                                           "events")
コード例 #8
0
 def test_list_event_with_kwargs(self):
     stack_id = 'teststack',
     resource_name = 'testresource'
     kwargs = {
         'limit': 2,
         'marker': '6d6935f4-0ae5',
         'filters': {
             'resource_action': 'CREATE',
             'resource_status': 'COMPLETE'
         }
     }
     manager = EventManager(None)
     self.m.StubOutWithMock(manager, '_resolve_stack_id')
     manager._resolve_stack_id(stack_id).AndReturn('teststack/abcd1234')
     self.m.ReplayAll()
     manager._list = MagicMock()
     manager.list(stack_id, resource_name, **kwargs)
     # Make sure url is correct.
     manager._list.assert_called_once_with(
         '/stacks/teststack%2Fabcd1234/'
         'resources/testresource/events'
         '?marker=6d6935f4-0ae5&limit=2'
         '&resource_action=CREATE&'
         'resource_status=COMPLETE', "events")