Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clstokes/pulumi-aws-py-webserver-unit-testing
A Pulumi application to to run unit tests against a web server.
https://github.com/clstokes/pulumi-aws-py-webserver-unit-testing
pulumi pulumi-aws
Last synced: 17 days ago
JSON representation
A Pulumi application to to run unit tests against a web server.
- Host: GitHub
- URL: https://github.com/clstokes/pulumi-aws-py-webserver-unit-testing
- Owner: clstokes
- Created: 2019-06-14T06:02:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-14T22:03:52.000Z (over 5 years ago)
- Last Synced: 2024-11-08T13:55:35.493Z (2 months ago)
- Topics: pulumi, pulumi-aws
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Unit Testing with Pulumi
## To Run Tests
```
$ python3 -m unittest tests
```### Example Output
```
$ python3 -m unittest tests
...
======================================================================
FAIL: test_no_internet_access (tests.InstanceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/clstokes/cc/clstokes/pulumi-aws-py-webserver-unit-testing/tests.py", line 15, in wrapper
loop.run_until_complete(coro(*args, **kwargs))
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/Users/clstokes/cc/clstokes/pulumi-aws-py-webserver-unit-testing/tests.py", line 34, in test_no_internet_access
self.assertNotEqual('0.0.0.0/0', cidr)
AssertionError: '0.0.0.0/0' == '0.0.0.0/0'======================================================================
FAIL: test_no_userdata (tests.InstanceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/clstokes/cc/clstokes/pulumi-aws-py-webserver-unit-testing/tests.py", line 15, in wrapper
loop.run_until_complete(coro(*args, **kwargs))
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/Users/clstokes/cc/clstokes/pulumi-aws-py-webserver-unit-testing/tests.py", line 46, in test_no_userdata
self.assertIsNone(user_data)
AssertionError: '\n#!/bin/bash\necho "Hello, World!" > index.html\nnohup python -m SimpleHTTPServer 80 &\n' is not None----------------------------------------------------------------------
Ran 2 tests in 0.178sFAILED (failures=2)
```