{ "info": { "author": "Oisin Mulvihill", "author_email": "oisin mulvihill at gmail com", "bugtrack_url": null, "classifiers": [], "description": "===================\nTest Harness Readme\n===================\n\n:author: Oisin Mulvihill\n\n.. contents::\n\n\nIntroduction\n============\n\nThis is intended to be used as a generic functional test framework.\n\nThis uses a simple script system, based on the python console, to load and run commands from test \nmodules. The test modules are python classes that implement the details of how to test the project or\nprogram. The module provides a simple set of functions that can be called from a script. The functions\ncan for example, take care of the complexity of starting some service or actually setting/getting some\nvalue in a database. In the script each function call can then be asserted to test what's returned. This\nthe is used to pass or fail a test.\n\nI've used this project to test interactions between network services, database driven applications, GUI\ntesting via pyGTK or in many other situations. I use it mainly to implement user acceptance stories to\nverify the behavior of a some user functionality. I don't use it to test web pages as there are better\nthings out there for this (I use selenium remote control).\n\nI originally developed this project back in 2001 and I've used it to test a few commercial products, that\nmy company and others have developed. I've got several versions of this project in various places. I've\nits time to bring them all together into one release. This is also an exercise for to learn how to write\npackages using setuptools.\n\n\nRunning the test harness\n========================\n\nCurrently the test harness is run out of the pytester directory. The following\ninstructions apply only to this situation.\n\n* Copy the file ./lib/testharness/config/tester.ini.in to ./tester.ini\n\n* Copy the file ./lib/testharness/testharness_log.ini.in to ./testharness_log.ini\n\n* Edit the tester.ini if needed.\n\n* Edit the log.ini if needed.\n\n* From the command line issues the following to run the test harness. All the tests mentioned in the tester.ini will now be run one after another.::\n\n PYTHONPATH=lib python ./lib/testharness/scripts/runacceptance\n\nOr\n\n goharness\n\n\n\nCommand line arguments\n======================\n\nThe test harness takes a number of command line arguments.\n\n-c, --config \n--------------------------\n\nThis specifies the configuration file the test harness is going to use. This\nfile is required and if it is not specified, then the file \"tester.ini\" is\nlooked for in the current path.\n\n\n-l, --logconfig \n----------------------------\n\nThis specifies the logging configuration use. This file set up where log\nmessages go, etc. By default the test harness looks for a file called\n\"log.ini\" in the current path.\n\n\n-i, --interactive\n-----------------\n\nThis tells the test harness not to start running tests mentioned in the\ntester ini file, but instead to go into interaction mode. This allows the\nuser to type the commands in manually.\n\n--testpath \n--------------------------\n\nThis tells the test harness where to find all the tests and test modules it\nis going to use. If this is not specified the the testharness will look for\nthe \"acceptancetests\" directory in the current path.\n\n\ntester.ini configuration\n-------------------------\n\nThis file is used to configure the test harness and any modules that are\nloaded. The TestHarness section contains, as you might expect, settings\nused by the test harness. The following is a typical tester.ini::\n\n [TestHarness]\n assert_equals_failure_causes_exit = yes\n tests = my_default_tests_to_run.script\n\n\nTestHarness section\n-------------------\n\nassert_equals_failure_causes_exit\n+++++++++++++++++++++++++++++++++\n\nThis tells the test harness to stop processing a test script if an assertEquals\nfails in a test. If this was \"no\" the test harness would try to continue\nprocessing the script. A \"yes\" value here is the default, \"no\" is only used in\ndebugging and is not recomended in normal situations.\n\ntests\n+++++\n\nThis is a list of scripts the test harness will run when it starts. These are\nfile names seperated by spaces and all on the same line. Currently you cannot\nspan multiple lines. Note also that the test harness expects to find these\nfiles in the --testpath directory.\n\n\n\nTest scripts\n============\n\nAll tests usually start with \\*.script. Thats just a convention I started using.\nThe files can be called whatever you want.\n\n\nTest script and test harness console commands\n---------------------------------------------\n\nThe test harness has a number of built in functions that can be called. These\nfunctions can be called from a script file or from the console. There is no real\ndistinction.\n\n\nload \n------------------\n\nThis loads a test module into the test harness. Test harness modules are python\nscript files that contain classes derived from TestBase. When you specify the\nmodule you don't specify '.py' extension.\n\n*Note*\n\nOnly class derived from TestBase will be loaded everything else is ignored.\n\n\nhelp []\n----------------------\n\nThis function gives help on a command name or lists all functions in the\nTestHarness.\n\n\nexit\n----\n\nThis tells the test harness to exit after call shutdown.\n\n\nrem\n----\n\nThis is only really useful inside a script file. Any line starting with this is\nignored.\n\n\nprint \n----------------------------\n\nThis is only really useful inside a script file. This function prints a line of\ntext to stdout.\n\n\nshutdown\n--------\n\nThis function is usually called just before the test harness exits. This\nfunction goes through each loaded module and calls its start() method.\n\n\nstart \n-------------------\n\nThis function call a loaded modules start() method.\n\n\nstop \n-------------------\n\nThis function call a loaded modules start() method.\n\nlist\n----\n\nThis function lists all loaded modules in the test harness.\n\n\ninspect \n---------------------\n\nThis function calls a modules inspect() method to print out a list of available\nfunction calls.\n\nNote: It is up to module writer to actually write the information that is\nreturned for printing.\n\n\nevaluate ,,,...\n-----------------------------------------------------------------------\n\nThis function calls a method in a module. Normally this function isn't called by\nthe user directly. Instead anything which isn't a built in function is assumed\nto be a module method call.\n\nFor example:\n\nA module called 'mytest' has one class called 'MainTest'. The 'MainTest'\nfunction has a method called 'doMyTest1' and it takes two arguments, a number\nand a string.\n\nThis could be invoked using the evaluate function as follows::\n\n evaluate mytest.MainTest doMyTest1 123,this is a string\n\nHowever the following also works::\n\n mytest.MainTest doMyTest1 123,this is a string\n\n*Notes*\n\nArguments are seperated by commas and these cannot be used by the user in\nthe script.\n\nArguemts should have no white space before or after them, unless you want\nthis as it will be passed to the function.\n\nFor example::\n\n doMyTest1 123,this is a string,4321\n doMyTest2 123, this is a string ,4321 ,\n\ndoMyTest1 will passed the args \"123\" \"this is a string\" and \"4321\"\ndoMyTest1 will passed the args \"123\" \" this is a string \" and \"4321 \"\n\n\nassertEquals ,\n------------------------------------------------------\n\nThis function compares the provided string, with that returned\nby the last user module script call.\n\nFor example::\n\n mytest.MainTest doMyTest1 123,this is a string\n\nThis call returns a number. This function is converted to a string and stored by\nthe test harness. Now the assertEquals can be used to test the return as follows::\n\n assertEquals doMyTest1 didn't work,12\n\nIf the returned value from doMyTest1 was 12 then assertEquals will pass. If\ndoMyTest1 didn't return 12 then the message 'doMyTest1 didn't work' will be\nprinted.\n\n*Note*\n\nIf the test harness assert config option is 'yes' the a failing\nassertEquals call will cause the test harness to stop running the script and\nreturn with a failure code.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "testharness", "package_url": "https://pypi.org/project/testharness/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/testharness/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/testharness/1.0.5/", "requires_dist": null, "requires_python": null, "summary": "This is intended to be used as a generic functional test framework.", "version": "1.0.5" }, "last_serial": 800485, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9fcabbf2595763903d42bbb7050f2e26", "sha256": "cd99024645609585fb17ce0e46bd5928ca8230c79774c6f2e1eeaed9542bbc6d" }, "downloads": -1, "filename": "testharness-1.0.0-py2.4.egg", "has_sig": false, "md5_digest": "9fcabbf2595763903d42bbb7050f2e26", "packagetype": "bdist_egg", "python_version": "any", "requires_python": null, "size": 37999, "upload_time": "2007-08-16T15:54:22", "url": "https://files.pythonhosted.org/packages/e5/9b/86d39af462254a709d7562f6e2fde4ee91c6a6ada3309a222e97d7c15129/testharness-1.0.0-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "09d2d3635b2c475325045e56cfd21d1d", "sha256": "d19bf64a2783298ac9dce52c3af803c83d6cfd0c3e938931f1c5a36613c61e31" }, "downloads": -1, "filename": "testharness-1.0.0-py2.5.egg", "has_sig": false, "md5_digest": "09d2d3635b2c475325045e56cfd21d1d", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 4775, "upload_time": "2008-03-29T21:43:16", "url": "https://files.pythonhosted.org/packages/5a/47/5c6b837d26260897036ee689155d12f9d24755bdced290e1cc0729b932fb/testharness-1.0.0-py2.5.egg" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7367ec31ae6066a4136f59c71f99260d", "sha256": "2c9629dcba53717eff5325ed4c85cddd143a13cea98f283b937c43a2c144c8a9" }, "downloads": -1, "filename": "testharness-1.0.1-py2.5.egg", "has_sig": false, "md5_digest": "7367ec31ae6066a4136f59c71f99260d", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 37649, "upload_time": "2008-08-07T12:41:52", "url": "https://files.pythonhosted.org/packages/f9/74/26119ea3a0f33af652c81c60d608cad97fb9042d7c0518d188619399aafb/testharness-1.0.1-py2.5.egg" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4e3fdd9f3f7e33e60e616bba34e89fde", "sha256": "50c578ab2fb415c002cb8788a3db3a183631c65a9f4f35a3f03f35bbabe32b5c" }, "downloads": -1, "filename": "testharness-1.0.2-py2.4.egg", "has_sig": false, "md5_digest": "4e3fdd9f3f7e33e60e616bba34e89fde", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 38166, "upload_time": "2008-08-07T13:01:59", "url": "https://files.pythonhosted.org/packages/e4/7b/e805ccb44f628cc67e367f14382a4af0c69f96c2322bd246d17a3afbf72f/testharness-1.0.2-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "a2ff0b0ee2e478c4b2a6d1dcb6b01cf9", "sha256": "551921979eff40a393ea42665a2f4150bab6dd726174c1711fc9e1bb559ae7e5" }, "downloads": -1, "filename": "testharness-1.0.2-py2.5.egg", "has_sig": false, "md5_digest": "a2ff0b0ee2e478c4b2a6d1dcb6b01cf9", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 37871, "upload_time": "2008-08-07T12:57:26", "url": "https://files.pythonhosted.org/packages/4b/78/9f2134bf03215038ccd1976f9099314c9c4f08087eb58e8afb5832199b33/testharness-1.0.2-py2.5.egg" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "54719b73b563fca2aa33efaa20fb8373", "sha256": "a67c933cc16eb65829ac373f360fba85f93651828f4ac586debfe73356771f56" }, "downloads": -1, "filename": "testharness-1.0.3-py2.4.egg", "has_sig": false, "md5_digest": "54719b73b563fca2aa33efaa20fb8373", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 37341, "upload_time": "2009-02-05T00:02:39", "url": "https://files.pythonhosted.org/packages/9f/61/12b0852ea78cdf23f8a004729708e4c33c057bd191af31048df2f7683ff7/testharness-1.0.3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "1ca86f16661bb682964c6e5da18c117c", "sha256": "cf68b5e743c0a1f8ae3a5e0fc8e44dee8005ed44fc5888f297e41f041d2e22d0" }, "downloads": -1, "filename": "testharness-1.0.3-py2.5.egg", "has_sig": false, "md5_digest": "1ca86f16661bb682964c6e5da18c117c", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 37045, "upload_time": "2009-02-05T00:00:21", "url": "https://files.pythonhosted.org/packages/6c/5d/bb6d39ca2e70c33b661810e4fb98e820017a8ca3163a926b4fb0e8cc5f03/testharness-1.0.3-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "f457aa194c6f94d15425f39978102d9c", "sha256": "6f39bc34c40e0efd074cdf9c62cc28e2583c45907ae6439e2e7f512b702330f1" }, "downloads": -1, "filename": "testharness-1.0.3-py2.6.egg", "has_sig": false, "md5_digest": "f457aa194c6f94d15425f39978102d9c", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 37046, "upload_time": "2009-02-05T00:00:14", "url": "https://files.pythonhosted.org/packages/d8/fc/e4cc8e28a45623c59e2163bd27957ccb2b15d2197cd1b506ac3f9f279ac7/testharness-1.0.3-py2.6.egg" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "f7dd835a2a4e733f2b43fff3b0110128", "sha256": "deabe79ae107dbfa13986a31f53f502197e0e7aeede64d0c99148a9b8b4c7be1" }, "downloads": -1, "filename": "testharness-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f7dd835a2a4e733f2b43fff3b0110128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30537, "upload_time": "2009-04-05T20:32:10", "url": "https://files.pythonhosted.org/packages/d4/c3/15209c1c8dee7795e660f2e6e7a6d5309c0adb13c8aab3f6c82ceac154bb/testharness-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "f40edfffebb6c46abc8c59a8d4a7b7fe", "sha256": "8c90b18f2d7ee89392dbe5f0ecfebea1097b21552c96c64cfbd7b25b279d734b" }, "downloads": -1, "filename": "testharness-1.0.5.tar.gz", "has_sig": false, "md5_digest": "f40edfffebb6c46abc8c59a8d4a7b7fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30768, "upload_time": "2009-04-05T20:45:02", "url": "https://files.pythonhosted.org/packages/f2/ca/3101ab48afe30088c279d08da5146682261fad3f87d48cbd13eccc27bca2/testharness-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f40edfffebb6c46abc8c59a8d4a7b7fe", "sha256": "8c90b18f2d7ee89392dbe5f0ecfebea1097b21552c96c64cfbd7b25b279d734b" }, "downloads": -1, "filename": "testharness-1.0.5.tar.gz", "has_sig": false, "md5_digest": "f40edfffebb6c46abc8c59a8d4a7b7fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30768, "upload_time": "2009-04-05T20:45:02", "url": "https://files.pythonhosted.org/packages/f2/ca/3101ab48afe30088c279d08da5146682261fad3f87d48cbd13eccc27bca2/testharness-1.0.5.tar.gz" } ] }