Skip to content

Commit

Permalink
Merge branch 'v0.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
damies13 committed Nov 28, 2020
2 parents 2773c05 + f7c4059 commit 72456c6
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
*Tests/*.png
*Tests/*driver.log
Resources/*
dist/*
build/*
testdatatable.egg-info/*
51 changes: 40 additions & 11 deletions Doc/InstallationAndConfiguration.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# TestDataTable Installation and Configuration

## Installation
- [PIP Installation](#pip-installation)
- [Configuration](#configuration)
- [Command Line Interface](#command-line-interface)
- [Manual Installation](#manual-installation)

- The TestDataTable machine needs to use a minimum of Python 3.7
> ThreadingHTTPServer feature of HTTPServer requires was added in Python 3.7

Additionally the following pip command might be needed if these are not already installed on your system:
## PIP Installation

If you already have Python with pip installed, you can simply run:

```
pip* install configparser setuptools HTTPServer sqlite3worker
pip install testdatatable
```
> setuptools (is required by HTTPServer)

\*some systems might need you to use pip3 and or sudo
This should install all the dependancies for you. Once installed you will need to identify the location of your dist-packages folder so you can find the 'TestDataTable.py' script to run it.

After these components are installed you can simply run:
This is where it was installed on a Ubuntu 20.04 machine:
```
python* TestDataTable.py
/usr/local/lib/python3.8/dist-packages/testdatatable/TestDataTable.py
```
\*some systems might need you to use python3 or use the full path to the python executable.

To stop TestDataTable simply type Control-c in the command window where TestDataTable is running and it will shutdown cleanly.
Then you can start Test Data Table with the command:
```
python3 /<path to file>/TestDataTable.py
```


Otherwise refer to the [manual installation instructions](#manual-installation).

## Configuration

Expand Down Expand Up @@ -126,3 +134,24 @@ optional arguments:
IP Address to bind the server to
-p PORT, --port PORT Port number to bind the server to
```

## Manual Installation

- The TestDataTable machine needs to use a minimum of Python 3.7
> ThreadingHTTPServer feature of HTTPServer requires was added in Python 3.7
Additionally the following pip command might be needed if these are not already installed on your system:
```
pip* install configparser setuptools HTTPServer sqlite3worker
```
> setuptools (is required by HTTPServer)
\*some systems might need you to use pip3 and or sudo

After these components are installed you can simply run:
```
python* TestDataTable.py
```
\*some systems might need you to use python3 or use the full path to the python executable.

To stop TestDataTable simply type Control-c in the command window where TestDataTable is running and it will shutdown cleanly.
13 changes: 13 additions & 0 deletions PackageCommands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# docs - https://packaging.python.org/tutorials/packaging-projects/

1) # create package
python3 setup.py sdist bdist_wheel

2) # upload package to test pypi
# python3 -m twine upload --repository testpypi dist/*
python3 -m twine upload --repository testpypi dist/*2.2.2*

3) # upload package to pypi
python3 -m twine upload dist/*
python3 -m twine upload dist/*2.2.2*
20 changes: 20 additions & 0 deletions README_PyPi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# TestDataTable

## About

TestDataTable is a web-based application that offers an alternative to static data sheets (text files, excel, etc.). When you use static data sheets, each test script is assigned parameter values from a dedicated set of values, values are either not shared between test scripts or are duplicated in each script. In contrast, TestDataTable enables you to assign test data variable values from a single set of data to multiple scripts while allowing you to ensure each script has a unique data value. This may enable you to more accurately emulate a real-user environment.

## Testing

The [Regression_Tests](https://github.com/damies13/TestDataTable/blob/master/Regression_Tests) folder contains the current Regression Test Suite, I would love to hear the results of running this suite against Test Data Table on your machine, especially a Window Machine (as I don't have one)

## Getting Help

- [TestDataTable Documentation](https://github.com/damies13/TestDataTable/blob/master/Doc/Index.md)
- [Discord](https://discord.gg/5wYA6K)
- [Reporting Issues / Known Issues](https://github.com/damies13/TestDataTable/issues)

## Donations

If you would like to thank me for this project please use this [PayPal.me](https://paypal.me/damies13/5) link, the $5 is a suggestion, feel free to change to any amount you would like.
9 changes: 5 additions & 4 deletions git/hooks-mac/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ version=$(git rev-parse --abbrev-ref HEAD)
# echo "version: $version"
if [[ "$version" =~ v[0-9]\. ]]; then
# echo "version: $version"
sed -i '' -e "s/version = \"[^\"]*\"/version = \"${version}\"/" *.py
numver=$(echo $version | sed -E 's/v(.*)/\1/')
sed -i '' -e "s/version *= *\"[^\"]*\"/version=\"${numver}\"/" $(find . -name "*.py")
# Version Test
sed -i '' -e "s/# Version .*/# Version ${version}/" *.py
sed -i '' -e "s/# Version .*/# Version ${version}/" $(find . -name "*.py")
# git commit -m "Update version to ${version}"
if ! git diff-index --quiet HEAD --; then
# echo "commit: Update version to $version"
git add *.py
git commit -m "Update version to ${version}"
git add $(find . -name "*.py")
git commit -m "Update version to ${version}"
fi
# else
# echo "version ($version) not pattern 'v[0-9]\.'"
Expand Down
32 changes: 32 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import setuptools

with open("README_PyPi.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="testdatatable",
version="0.2.3",
author="damies13",
author_email="[email protected]",
description="TestDataTable",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/damies13/TestDataTable",
packages=setuptools.find_packages(),
# packages=setuptools.find_packages(include=['configparser', 'setuptools', 'HTTPServer', 'sqlite3worker']),
# packages=setuptools.find_packages(include=['configparser', 'HTTPServer', 'sqlite3worker']),
install_requires=['configparser', 'HTTPServer', 'sqlite3worker'],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: Software Development :: Testing",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.7',
project_urls={
'Getting Help': 'https://github.com/damies13/TestDataTable#getting-help',
'Say Thanks!': 'https://github.com/damies13/TestDataTable#donations',
'Source': 'https://github.com/damies13/TestDataTable',
},
)
19 changes: 15 additions & 4 deletions TestDataTable.py → testdatatable/TestDataTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Test Data Table
#
# Version v0.2.2
# Version v0.2.3
#


Expand Down Expand Up @@ -110,6 +110,7 @@ def do_DELETE(self):
message = str(e)
try:
self.send_response(httpcode)
self.send_header("Server", "Test Data Table v"+core.version)
self.end_headers()
self.wfile.write(bytes(message,"utf-8"))
except BrokenPipeError as e:
Expand Down Expand Up @@ -231,6 +232,7 @@ def do_PUT(self):

try:
self.send_response(httpcode)
self.send_header("Server", "Test Data Table v"+core.version)
self.end_headers()
self.wfile.write(bytes(message,"utf-8"))
except BrokenPipeError as e:
Expand Down Expand Up @@ -307,6 +309,7 @@ def do_POST(self):

try:
self.send_response(httpcode)
self.send_header("Server", "Test Data Table v"+core.version)
self.end_headers()
self.wfile.write(bytes(message,"utf-8"))
except BrokenPipeError as e:
Expand Down Expand Up @@ -1334,6 +1337,8 @@ def do_GET(self):

message += "<style>"
message += "#buttonbar { float: right; }"
message += "#version { float: left; font-size: 30%; }"
message += "#title { float: left; }"
message += "</style>"

message += "<title>Test Data Table</title>"
Expand Down Expand Up @@ -1452,9 +1457,13 @@ def do_GET(self):
#
# Main page
#

#version font-size: 30%;
# <fieldset>
# message += "<div id=\"title\" class=\"ui-widget\">Test Data Table</div>"
# message += "<div id=\"version\" class=\"ui-state-disabled ui-widget\">Version " + core.version + "</div>"
message += "<div id=\"buttonbar\">"
# message += " <button>Test Data Table</button>" # spacer
# message += " <button disabled><span style=\"font-size: 30%;\">Version "+core.version+"</span>&nbsp;</button>"
message += " <button id='new-table' class=\"ui-button ui-widget ui-corner-all ui-button-icon-only\" title=\"Add Table\"><span class=\"ui-icon ui-icon-calculator\"></span>Add Table</button>"
message += " <button id='new-column' class=\"ui-button ui-widget ui-corner-all ui-button-icon-only\" title=\"Add Column\"><span class=\"ui-icon ui-icon-grip-solid-vertical\"></span>Add Column</button>"
message += " <button>&nbsp;</button>" # spacer
Expand All @@ -1476,7 +1485,7 @@ def do_GET(self):
message += " <option value='60' >Auto Refresh 1 minute</option>"
message += " </select>"
message += " <button id='refresh' class=\"ui-button ui-widget ui-corner-all ui-button-icon-only\" title=\"Refresh\"><span class=\"ui-icon ui-icon-refresh\"></span>Refresh</button>"
message += " <button id='help' class=\"ui-button ui-widget ui-corner-all ui-button-icon-only\" title=\"Help\"><span class=\"ui-icon ui-icon-help\"></span>Help</button>"
message += " <button id='help' class=\"ui-button ui-widget ui-corner-all ui-button-icon-only\" title=\" Help\nv" + core.version + "\"><span class=\"ui-icon ui-icon-help\"></span>Help</button>"
message += "</div>"

message += "<div style=\"height: 5%;\">"
Expand All @@ -1503,6 +1512,7 @@ def do_GET(self):

core.debugmsg(9, "httpcode:", httpcode)
self.send_response(httpcode)
self.send_header("Server", "Test Data Table v"+core.version)
self.end_headers()
with open(localfile,"rb") as f:
core.debugmsg(8, "file open for read")
Expand Down Expand Up @@ -1713,6 +1723,7 @@ def do_GET(self):
try:
core.debugmsg(9, "httpcode:", httpcode)
self.send_response(httpcode)
self.send_header("Server", "Test Data Table v"+core.version)
self.end_headers()
core.debugmsg(9, "message:", message)
if message is not None:
Expand All @@ -1737,7 +1748,7 @@ def log_request(self, code='-', size='-'):
pass

class TDT_Core:
version = "v0.2.2"
version="0.2.3"
debuglvl = 0

tdt_ini = None
Expand Down
1 change: 1 addition & 0 deletions testdatatable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# init file for pip setup.py packaging tool to find

0 comments on commit 72456c6

Please sign in to comment.