Skip to content

Commit 9bf5b8c

Browse files
committed
readme update
1 parent 09e7a39 commit 9bf5b8c

2 files changed

Lines changed: 27 additions & 21 deletions

File tree

README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
# LOCALSTACK-UTILS
2-
Python utility to integrate Localstack with Unit tests.
2+
This Python utility streamlines the integration of Localstack, a local AWS cloud services mock, with unit tests. Seamlessly incorporate Localstack into your Python projects to facilitate efficient and reliable testing of AWS interactions within a controlled local environment. Enhance the development process by utilizing this utility to simulate AWS services during unit testing, ensuring robust and dependable code before deployment.
33

44
### Prerequisites
55
- Docker
66
- Localstack
77

88

9-
### Instalation (soon...)
9+
### Instalation
10+
``` bash
11+
pip install localstack-utils
12+
```
1013

1114
### Usage example
1215

1316
``` python
1417
import time
1518
import boto3
1619
import unittest
17-
from localstack_utils import startup_localstack, stop_localstack
20+
from localstack_utils.localstack import startup_localstack, stop_localstack
1821

19-
class kinesis_test(unittest.TestCase):
20-
def setUp(self):
21-
startup_localstack()
22-
session = boto3.session.Session()
22+
class TestKinesis(unittest.TestCase):
23+
def setUp(self):
24+
startup_localstack()
2325

24-
def tearDown(self):
25-
stop_localstack()
26-
return super().tearDown()
26+
def tearDown(self):
27+
stop_localstack()
28+
return super().tearDown()
2729

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')
30+
def test_create_stream(self):
31+
kinesis = boto3.client(
32+
service_name="kinesis",
33+
aws_access_key_id="test",
34+
aws_secret_access_key="test",
35+
endpoint_url="http://localhost:4566",
36+
)
3437

35-
kinesis.create_stream(StreamName='test', ShardCount=1)
36-
time.sleep(5)
38+
kinesis.create_stream(StreamName="test", ShardCount=1)
39+
time.sleep(1)
3740

38-
response = kinesis.list_streams()
39-
self.assertGreater(len(response.get('StreamNames', [])),0)
41+
response = kinesis.list_streams()
42+
self.assertGreater(len(response.get("StreamNames", [])), 0)
4043
```
44+
45+
## Change Log
46+
* 1.0.0: Initial version

setug.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = localstack-utils
3-
version = attr: localstack_utils.__version__
3+
version = 1.0.0
44
author = Cristopher Pinzon
55
author_email = cristopher.pinzon@localstack.cloud
66
summary = LocalStack Utils for testing

0 commit comments

Comments
 (0)