Initial commit
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM docker.io/python:3.10-alpine
|
||||||
|
|
||||||
|
COPY . src
|
||||||
|
RUN cd src && pip install --no-cache-dir .
|
||||||
|
|
||||||
|
CMD ["python", "-m", "myproj"]
|
||||||
22
LICENSE.txt
Normal file
22
LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright © 2022
|
||||||
|
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the “Software”), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
13
pyproject.toml
Normal file
13
pyproject.toml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[project]
|
||||||
|
name = "pyprotest"
|
||||||
|
version = "0.0.1"
|
||||||
|
description = "My pyproject test"
|
||||||
|
readme = "README.md"
|
||||||
|
license = { file = "LICENSE.txt" }
|
||||||
|
authors = [
|
||||||
|
{ name = "Dietrich Rink" }
|
||||||
|
]
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
"requests ~= 2.27.1"
|
||||||
|
]
|
||||||
5
pyprotest/__main__.py
Normal file
5
pyprotest/__main__.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from .request import make_request
|
||||||
|
|
||||||
|
resp = make_request()
|
||||||
|
print(resp.status_code)
|
||||||
|
print(resp.text)
|
||||||
4
pyprotest/request.py
Normal file
4
pyprotest/request.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
def make_request():
|
||||||
|
return requests.get('https://wtfismyip.com/text')
|
||||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
9
tests/test_request.py
Normal file
9
tests/test_request.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
from pyprotest import request
|
||||||
|
|
||||||
|
class TestRequest(TestCase):
|
||||||
|
def test_request(self):
|
||||||
|
resp = request.make_request()
|
||||||
|
self.assertEqual(resp.status_code, 200)
|
||||||
|
|
||||||
Reference in New Issue
Block a user