| 35 | |
| 36 | # Mock EC2 service for testing |
| 37 | class MockEC2Service: |
| 38 | def __init__(self, credentials=None): |
| 39 | self.credentials = credentials |
| 40 | |
| 41 | def list_instances(self, filters=None): |
| 42 | return [ |
| 43 | { |
| 44 | 'InstanceId': 'i-1234567890abcdef0', |
| 45 | 'State': {'Name': 'running'}, |
| 46 | 'InstanceType': 't2.micro', |
| 47 | 'Tags': [{'Key': 'Name', 'Value': 'test-instance'}], |
| 48 | 'LaunchTime': '2023-01-01T00:00:00Z' |
| 49 | } |
| 50 | ] |
| 51 | |
| 52 | def create_instance(self, name, instance_type, ami_id, subnet_id, security_group_ids, key_name, wait=False): |
| 53 | return { |
| 54 | 'InstanceId': 'i-1234', |
| 55 | 'State': {'Name': 'running'}, |
| 56 | 'InstanceType': instance_type |
| 57 | } |
| 58 | |
| 59 | # Mock GitHub service for testing |
| 60 | class MockGitHubService: |
no outgoing calls