Skip to content

Commit 4079dc6

Browse files
authored
Merge pull request #31 from crazi-coder/automation
Rename the folder to support naming convention with repo
2 parents e563f87 + c0079d2 commit 4079dc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+902
-553
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# .coveragerc to control coverage.py
22
[run]
33
branch = True
4-
omit = py3resttest/runner.py
4+
omit = resttest3/runner.py
55

66
command_line = --source py3resttest -m pytest tests/test_*.py
77
[paths]
88
source =
9-
py3resttest/
9+
resttest3/
1010

1111
[report]
1212
# Regexes for lines to exclude from consideration

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
- name: Lint with flake8
3030
run: |
3131
# stop the build if there are Python syntax errors or undefined names
32-
flake8 py3resttest --count --select=E9,F63,F7,F82 --show-source --statistics
32+
flake8 resttest3 --count --select=E9,F63,F7,F82 --show-source --statistics
3333
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3434
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics
3535
- name: Test with pytest
3636
run: |
37-
coverage run --source py3resttest -m pytest tests/test_*.py
37+
coverage run --source resttest3 -m pytest tests/test_*.py
3838
- name: Upload Coverage
3939
run: coveralls
4040
env:

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM python:3.5-alpine
2+
# Install packages
3+
RUN apk add --no-cache libcurl
4+
5+
# Needed for pycurl
6+
ENV PYCURL_SSL_LIBRARY=openssl
7+
RUN apk add --no-cache --virtual .build-dependencies build-base curl-dev \
8+
&& pip install pycurl \
9+
&& apk del .build-dependencies
10+
RUN pip install --upgrade pip
11+
RUN pip install flake8 pytest coverage
12+
COPY requirements.txt /tmp/requirements.txt
13+
14+
#RUN pip install --no-cache-dir -r /tmp/requirements.txt
15+
16+
COPY . /resttest3
17+
WORKDIR /resttest3
18+
19+
20+
RUN python setup.py bdist_wheel
21+
RUN pip install -U dist/*
22+
RUN flake8 resttest3 --count --select=E9,F63,F7,F82 --show-source --statistics
23+
RUN flake8 resttest3 --count --exit-zero --max-complexity=30 --max-line-length=127 --statistics
24+
# RUN python -m pytest tests
25+
RUN coverage run --source resttest3 -m pytest tests/test_*.py
26+
RUN coverage report
27+
#RUN resttest3 --url https://www.courtlistener.com --test tests/fun_test.yaml
28+

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
py3resttest
2-
==========
3-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/abhijo89-to/resttest3/Python%20package)
1+
RestTest3
2+
=========
3+
4+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/crazi-coder/resttest3/Python%20package)
45
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/resttest3)
56
![PyPI - Wheel](https://img.shields.io/pypi/wheel/resttest3)
67
![PyPI](https://img.shields.io/pypi/v/resttest3)
7-
[![PyPI - Downloads](https://img.shields.io/pypi/dm/resttest3)](https://pypistats.org/packages/resttest3)
8-
[![Coverage Status](https://coveralls.io/repos/github/abhijo89-to/resttest3/badge.svg)](https://coveralls.io/github/abhijo89-to/resttest3)
9-
[![SourceLevel](https://app.sourcelevel.io/github/crazi-coder/resttest3.svg)](https://app.sourcelevel.io/github/crazi-coder/resttest3)
10-
[![CodeFactor](https://www.codefactor.io/repository/github/crazi-coder/resttest3/badge)](https://www.codefactor.io/repository/github/abhijo89-to/resttest3)
8+
![PyPI - Downloads](https://img.shields.io/pypi/dm/resttest3)
9+
[![Coverage Status](https://coveralls.io/repos/github/crazi-coder/resttest3/badge.svg)](https://coveralls.io/github/crazi-coder/resttest3/)
10+
[![SourceLevel](https://app.sourcelevel.io/github/crazi-coder/resttest3.svg)](https://app.sourcelevel.io/github/crazi-coder/resttest3/)
11+
[![CodeFactor](https://www.codefactor.io/repository/github/crazi-coder/resttest3/badge)](https://www.codefactor.io/repository/github/crazi-coder/resttest3/)
12+
1113

1214

13-
Please read [documentation](https://abhijo89-to.github.io/py3resttest/). We are doing active development for python3 and removed python2 support
15+
Please read [documentation](https://crazicoder.com/). We are doing active development for python3 and removed python2 support
1416

1517
This project is a fork of [pyresttest](https://github.com/svanoort/pyresttest)

coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22
# pip install coverage
3-
coverage run --source py3resttest -m pytest tests/test_*.py
3+
coverage run --source resttest3 -m pytest tests/test_*.py
44
coverage html
55
coverage report

docs/_config.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/extensions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ python pyresttest/resttest.py https://api.github.com fancypants_test.yaml --impo
2222

2323
## What does an extension look like?
2424
```python
25-
import py3resttest.validators as validators
25+
import resttest3.validators as validators
2626

2727
# Define a simple generator that doubles with each value
2828
def parse_generator_doubling(config):
@@ -44,11 +44,6 @@ GENERATORS = {'doubling': parse_generator_doubling}
4444

4545
If this is imported when executing the test, you can now use this generator in tests.
4646

47-
# Full Example
48-
See the [sample extension](pyresttest/tests/sample_extension.py).
49-
It shows an extension for all extensible functions.
50-
51-
5247
# What Doe An Extension Need To Work?
5348

5449
1. Function(s) to run
@@ -105,6 +100,8 @@ The 'parse' function below will be registered in the registry.
105100

106101
Example:
107102
```python
103+
104+
from resttest3.validators import AbstractExtractor
108105
class HeaderExtractor(AbstractExtractor):
109106
""" Extractor that pulls out a named header """
110107
extractor_type = 'header' # Printable name for the type
@@ -133,6 +130,9 @@ Validators should extend AbstractValidator.
133130
The parse function below will be registered in the registry VALIDATORS.
134131

135132
```python
133+
from resttest3.validators import AbstractValidator, _get_extractor, Failure
134+
from resttest3.utils import Parser
135+
from resttest3.constants import VALIDATOR_TESTS
136136
class ExtractTestValidator(AbstractValidator):
137137
""" Does extract and test from request body """
138138
name = 'ExtractTestValidator'
@@ -145,7 +145,7 @@ class ExtractTestValidator(AbstractValidator):
145145
def parse(config):
146146
""" Config is a dict """
147147
output = ExtractTestValidator()
148-
config = parsing.lowercase_keys(parsing.flatten_dictionaries(config))
148+
config = Parser.flatten_lowercase_keys_dict(config)
149149
output.config = config
150150
extractor = _get_extractor(config)
151151
output.extractor = extractor

0 commit comments

Comments
 (0)