Permalink
Browse files

Create gh-pages branch via GitHub

  • Loading branch information...
1 parent 550ce91 commit 5f114a2f7ce1feaec721a3bbc9c28abcf362d3b5 @spulec committed Mar 26, 2013
Showing with 2 additions and 7 deletions.
  1. +0 −5 index.html
  2. +1 −1 params.json
  3. +1 −1 stylesheets/stylesheet.css
View
@@ -98,11 +98,6 @@ <h2 id="project_tagline">Let your Python tests travel through time</h2>
<span class="k">assert</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="o">==</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">(</span><span class="mi">2012</span><span class="p">,</span> <span class="mo">01</span><span class="p">,</span> <span class="mi">14</span><span class="p">)</span>
</pre></div>
-<h2>Warning</h2>
-
-<p>For the time being, if you use datetime as <code>from datetime import datetime; now = datetime.now()</code> then freezegun module must be imported before the datetime module is ever imported for this to work.
-If you use datetime as <code>import datetime; now = datetime.datetime.now()</code>, then you're good to go without worrying about import order.</p>
-
<h2>Installation</h2>
<p>To install FreezeGun, simply:</p>
View
@@ -1 +1 @@
-{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"FreezeGun","tagline":"Let your Python tests travel through time","body":"# FreezeGun: Let your Python tests travel through time\r\n\r\nFreezeGun is a library that allows your python tests to travel through time by mocking the datetime module.\r\n\r\n## Usage\r\n\r\nOnce the decorator or context manager have been invoked, all calls to datetime.datetime.now(), datetime.datetime.utcnow(), and datetime.date.today() will return the time that has been frozen.\r\n\r\n### Decorator\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\n@freeze_time(\"2012-01-14\")\r\ndef test():\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n\r\n# Or class based\r\n\r\n@freeze_time(\"2012-01-14\")\r\nclass Tester(object):\r\n def test_the_class(self):\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n### Context Manager\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\ndef test():\r\n assert datetime.datetime.now() != datetime.datetime(2012, 01, 14)\r\n with freeze_time(\"2012-01-14\"):\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n assert datetime.datetime.now() != datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n### Raw use\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\nfreezer = freeze_time(\"2012-01-14 12:00:01\")\r\nfreezer.start()\r\nassert datetime.datetime.now() == datetime.datetime(2012, 01, 14, 12, 00, 01)\r\nfreezer.stop()\r\n```\r\n\r\n### Timezones\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\n@freeze_time(\"2012-01-14 03:21:34\", tz_offset=-4)\r\ndef test():\r\n assert datetime.datetime.utcnow() == datetime.datetime(2012, 01, 14, 03, 21, 34)\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 13, 23, 21, 34)\r\n\r\n # datetime.date.today() uses local time\r\n assert datetime.date.today() == datetime.datetime(2012, 01, 13)\r\n```\r\n\r\n### Nice inputs\r\n\r\nFreezeGun uses python-dateutil behind the scenes so you can have nice-looking datetimes\r\n\r\n```python\r\n@freeze_time(\"Jan 14th, 2012\")\r\ndef test_nice_datetime():\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n## Warning\r\n\r\nFor the time being, if you use datetime as `from datetime import datetime; now = datetime.now()` then freezegun module must be imported before the datetime module is ever imported for this to work. \r\nIf you use datetime as `import datetime; now = datetime.datetime.now()`, then you're good to go without worrying about import order.\r\n\r\n## Installation\r\n\r\nTo install FreezeGun, simply:\r\n\r\n```bash\r\n$ pip install freezegun\r\n```\r\n","google":"UA-10257980-1"}
+{"name":"FreezeGun","tagline":"Let your Python tests travel through time","body":"# FreezeGun: Let your Python tests travel through time\r\n\r\nFreezeGun is a library that allows your python tests to travel through time by mocking the datetime module.\r\n\r\n## Usage\r\n\r\nOnce the decorator or context manager have been invoked, all calls to datetime.datetime.now(), datetime.datetime.utcnow(), and datetime.date.today() will return the time that has been frozen.\r\n\r\n### Decorator\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\n@freeze_time(\"2012-01-14\")\r\ndef test():\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n\r\n# Or class based\r\n\r\n@freeze_time(\"2012-01-14\")\r\nclass Tester(object):\r\n def test_the_class(self):\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n### Context Manager\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\ndef test():\r\n assert datetime.datetime.now() != datetime.datetime(2012, 01, 14)\r\n with freeze_time(\"2012-01-14\"):\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n assert datetime.datetime.now() != datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n### Raw use\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\nfreezer = freeze_time(\"2012-01-14 12:00:01\")\r\nfreezer.start()\r\nassert datetime.datetime.now() == datetime.datetime(2012, 01, 14, 12, 00, 01)\r\nfreezer.stop()\r\n```\r\n\r\n### Timezones\r\n\r\n```python\r\nfrom freezegun import freeze_time\r\n\r\n@freeze_time(\"2012-01-14 03:21:34\", tz_offset=-4)\r\ndef test():\r\n assert datetime.datetime.utcnow() == datetime.datetime(2012, 01, 14, 03, 21, 34)\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 13, 23, 21, 34)\r\n\r\n # datetime.date.today() uses local time\r\n assert datetime.date.today() == datetime.datetime(2012, 01, 13)\r\n```\r\n\r\n### Nice inputs\r\n\r\nFreezeGun uses python-dateutil behind the scenes so you can have nice-looking datetimes\r\n\r\n```python\r\n@freeze_time(\"Jan 14th, 2012\")\r\ndef test_nice_datetime():\r\n assert datetime.datetime.now() == datetime.datetime(2012, 01, 14)\r\n```\r\n\r\n## Installation\r\n\r\nTo install FreezeGun, simply:\r\n\r\n```bash\r\n$ pip install freezegun\r\n```\r\n","google":"UA-10257980-1","note":"Don't delete this file! It's used internally to help with page regeneration."}
@@ -1,5 +1,5 @@
/*******************************************************************************
-Slate Theme for Github Pages
+Slate Theme for GitHub Pages
by Jason Costello, @jsncostello
*******************************************************************************/

0 comments on commit 5f114a2

Please sign in to comment.