Skip to content

Commit b88107f

Browse files
committed
initial readme
1 parent 9c756a4 commit b88107f

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# LOCALSTACK-UTILS
2+
Python utility to integrate Localstack with Unit tests.
3+
4+
### Prerequisites
5+
- Docker
6+
- Localstack
7+
8+
9+
### Instalation (soon...)
10+
11+
### Usage example
12+
13+
``` python
14+
import time
15+
import boto3
16+
import unittest
17+
from localstack_utils import startup_localstack, stop_localstack
18+
19+
class kinesis_test(unittest.TestCase):
20+
def setUp(self):
21+
startup_localstack()
22+
session = boto3.session.Session()
23+
24+
def tearDown(self):
25+
stop_localstack()
26+
return super().tearDown()
27+
28+
def test_create_stream(self):
29+
kinesis = boto3.client(
30+
service_name='kinesis',
31+
aws_access_key_id='test',
32+
aws_secret_access_key='test',
33+
endpoint_url='http://localhost:4566')
34+
35+
kinesis.create_stream(StreamName='test', ShardCount=1)
36+
time.sleep(5)
37+
38+
response = kinesis.list_streams()
39+
self.assertGreater(len(response.get('StreamNames', [])),0)
40+
```

0 commit comments

Comments
 (0)