Exemplo n.º 1
0
    def test_start_agent_elb(self, resource, kms, dynamo, elb, repeat, manager,
                             agent_db, tables, get_instance_id):
        get_instance_id.return_value = 'i-123456'

        start_agent(ENVIRONMENT, SERVICE, REGION, ELB, 0.1, 0.1)

        elb.assert_called_with(REGION)
Exemplo n.º 2
0
    def test_start_agent_messaging(self, resource, kms, dynamo, elb, repeat,
                                   manager, agent_db, tables, get_instance_id,
                                   get_queue):
        get_instance_id.return_value = 'i-123456'
        get_queue.return_value = MagicMock()

        start_agent(ENVIRONMENT, SERVICE, REGION, ELB, 0.1, 0.1)

        self.assertEquals(3, repeat.call_count)
Exemplo n.º 3
0
    def test_start_agent_no_elb(self, resource, kms, dynamo, elb, repeat,
                                manager, tables, get_instance_id, get_queue):
        get_queue.return_value = None
        get_instance_id.return_value = 'i-123456'

        start_agent(ENVIRONMENT, SERVICE, REGION, None, 0.1, 0.1)

        dynamo.assert_called_with(REGION)
        kms.assert_called_with(REGION)
        elb.assert_not_called()

        self.assertEquals(2, repeat.call_count)