{ "info": { "author": "Simone Robutti", "author_email": "simone.robutti@teraki.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Hypothesis", "Programming Language :: Python" ], "description": "==============\nhypothesis-csv\n==============\n\n\n:code:`hypothesis-csv` is an extension to the `hypothesis` framework. The goal of this framework is to offer a flexible tool\nto perform generative-testing/property-based testing for software that accepts CSV files as an input.\n\n\n\nDescription\n===========\n\n`hypothesis-csv` is designed with two main use cases in mind:\n\n* test software that accepts a wide spectrum of CSV formats and doesn't make assumptions on the content (i.e. CSV parsers)\n* test software that accepts very specific CSV formats and makes assumption on the content, types and header fields.\n\nIt provides two strategies, :code:`data_rows` and :code:`csv`, to pursue this goal, both contained in the `strategies` module.\nPlease refer to their documentation and the examples for more details.\n\nExamples\n========\n\nGenerate arbitrary, non-empty CSV\n---------------------------------\n\n.. code-block:: python\n :name: Generate arbitrary, non-empty CSV\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv())\n def test_my_csv_parse(csv):\n parsed_csv=my_csv_parser(csv)\n assert ...\n\nGenerate CSV of a given size (5 columns x 20 rows)\n--------------------------------------------------\n\n.. code-block:: python\n :name: Generate CSV of a given size (5 columns x 20 rows)\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv(lines=20,header=5))\n def test_my_csv_parse(csv):\n parsed_csv=my_csv_parser(csv)\n assert parsed_csv.num_columns == 5\n assert parsed_csv.num_rows == 20\n\n\n\nGenerate CSV with a header\n--------------------------\n.. code-block:: python\n :name: Generate CSV with a header\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv(header=[\"timestamp\",\"val_1\",\"val_2\"]))\n def test_my_csv_parse(csv):\n parsed_csv=my_csv_parser(csv)\n assert parsed_csv.num_columns == 3\n\n\nGenerate CSV with columns of a given type\n-----------------------------------------\n\n.. code-block:: python\n :name: Generate CSV with columns of a given type\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv(columns=[text(),int(),float()]))\n def test_my_csv_parse(csv):\n parsed_csv=my_csv_parser(csv)\n assert parsed_csv.num_columns == 3\n\n\nGenerate CSV with a given dialect\n---------------------------------\n\n.. code-block:: python\n :name: Generate CSV in a given dialect\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv(columns=[text(),int(),float()], dialect=\"excel-tab\"))\n def test_my_csv_parse(csv):\n ...\n\nGenerate CSV with drawns dialects\n---------------------------------\n\n.. code-block:: python\n :name: Generate CSV with drawns dialects\n\n from hypothesis_csv.strategies import csv\n @given(csv=csv(columns=[text(),int(),float()], dialect=None))\n def test_my_csv_parse(csv):\n ...", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chobeat/hypothesis-csv", "keywords": "", "license": "Apache License", "maintainer": "", "maintainer_email": "", "name": "hypothesis-csv", "package_url": "https://pypi.org/project/hypothesis-csv/", "platform": "any", "project_url": "https://pypi.org/project/hypothesis-csv/", "project_urls": { "Homepage": "https://github.com/chobeat/hypothesis-csv" }, "release_url": "https://pypi.org/project/hypothesis-csv/0.3.4/", "requires_dist": null, "requires_python": "", "summary": "CSV extension for the Hypothesis framework", "version": "0.3.4" }, "last_serial": 5345559, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "634c3fb8b33b26d02c45e5a595743d79", "sha256": "1eb7e3ac37c2d157466fc23b10a8efbda666bfb3c4cd97e21eca72837ef73c5d" }, "downloads": -1, "filename": "hypothesis-csv-0.3.1.tar.gz", "has_sig": false, "md5_digest": "634c3fb8b33b26d02c45e5a595743d79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17024, "upload_time": "2018-08-06T14:34:12", "url": "https://files.pythonhosted.org/packages/2e/da/0010fdfaac0521c0f824d897500223a7ac097530249036341cd4626c7eb1/hypothesis-csv-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "bc1c7547c0caf65afedca81a472995f6", "sha256": "b99c91ae63835cee92540b246b4624950df20b6d0b8fcab18749089212be16ee" }, "downloads": -1, "filename": "hypothesis-csv-0.3.2.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "bc1c7547c0caf65afedca81a472995f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6823, "upload_time": "2018-11-02T15:11:01", "url": "https://files.pythonhosted.org/packages/68/9d/96fb9f8b2c59443046afd0e9ae75b6b4ce5c5543a7bf8851ed2f54d84772/hypothesis-csv-0.3.2.linux-x86_64.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "2053ed7ba2b46bf9dfed887c8e674dff", "sha256": "dc2774b53e66d28e8995b540cf4697febc022199ad7cae813c2a37256295910b" }, "downloads": -1, "filename": "hypothesis-csv-0.3.3.tar.gz", "has_sig": false, "md5_digest": "2053ed7ba2b46bf9dfed887c8e674dff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17099, "upload_time": "2018-11-12T18:30:57", "url": "https://files.pythonhosted.org/packages/37/55/12af6c3f371b103e4990a412b57c46079e2bf420fc2bd8cb608972ea2721/hypothesis-csv-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "d066b5df1329719442696247a763fbe2", "sha256": "8716d10a93a22edce2c78544624056b412bd6083bde9e5a1166a02be57d55e6e" }, "downloads": -1, "filename": "hypothesis-csv-0.3.4.tar.gz", "has_sig": false, "md5_digest": "d066b5df1329719442696247a763fbe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17195, "upload_time": "2019-06-01T06:49:31", "url": "https://files.pythonhosted.org/packages/af/4b/b97ce73a2d0f638d8af8e11631bfd0aa6bfe3e4057b49f94a198f5e1216b/hypothesis-csv-0.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d066b5df1329719442696247a763fbe2", "sha256": "8716d10a93a22edce2c78544624056b412bd6083bde9e5a1166a02be57d55e6e" }, "downloads": -1, "filename": "hypothesis-csv-0.3.4.tar.gz", "has_sig": false, "md5_digest": "d066b5df1329719442696247a763fbe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17195, "upload_time": "2019-06-01T06:49:31", "url": "https://files.pythonhosted.org/packages/af/4b/b97ce73a2d0f638d8af8e11631bfd0aa6bfe3e4057b49f94a198f5e1216b/hypothesis-csv-0.3.4.tar.gz" } ] }