Instead of writing my tests scripts one at a time (testing the same type of data here), I am using the built in nose generator method.
from CheckService import CheckService
def test_generator():
sites=[ "ftp.esat.net",
# My Python Env here | |
VENV_NAME?=pe38 | |
VENV_ACTIVATE=. ~/$(VENV_NAME)/bin/activate | |
PYTHON= ~/${VENV_NAME}/bin/python3 | |
PIP = pip3 | |
# Execute a command and get the output.... THis is very Version specific | |
# Not needed but useful to know | |
# | |
PYSRC = ft8 | |
PYTEST = ft8/test |
from MySimpleModule import MySimpleModule | |
cls=None | |
def test_000_init(): | |
global cls | |
cls=MySimpleModule() | |
assert cls |
Instead of writing my tests scripts one at a time (testing the same type of data here), I am using the built in nose generator method.
from CheckService import CheckService
def test_generator():
sites=[ "ftp.esat.net",
from glob import glob | |
from PIL import Image | |
import numpy as np | |
def img_data(class_id,filename): | |
''' | |
Return an np array of | |
CLASS_NUMBER | |
''' |
def str_to_hex_str(s): | |
out="" | |
for c in s: | |
out+= "{:04x}".format(ord(c)) | |
return out | |
def hex_str_to_str(hs): | |
out="" |
When using a Venv (when dont I), the first line whould be like this. | |
#!/usr/bin/env python3 | |
Faker from command line | |
pip install faker | |
faker -l en_GB -r=500 profile ssn,birthdate,name,address,job,dob,phone,credit_card,company |
import json
import pprint
from collections import defaultdict
nested_dict = lambda: defaultdict(nested_dict)
query=nested_dict()
query['span_near']['clauses']=list()
query['slop']='1'