Skip to content

Commit

Permalink
Version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Vanhoren committed Jun 15, 2013
1 parent 46ede21 commit 992e1b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
12 changes: 11 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

# PyGreen

[See the web site for any information.](http://pygreen.neoname.eu)
[See the web site for any information.](http://pygreen.neoname.eu)

Version 1.0.3

Changelog:

* 1.0.3:

* Added *.py to excluded files
* Some minor API changes
* Bug fixes
6 changes: 3 additions & 3 deletions pygreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import unicode_literals
from __future__ import unicode_literals, print_function

import bottle
import os.path
Expand Down Expand Up @@ -173,8 +173,8 @@ def gen():

args = parser.parse_args(cmd_args)
self.set_folder(args.folder)
print parser.description
print ""
print(parser.description)
print("")
args.func()

pygreen = PyGreen()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os.path

setup(name='pygreen',
version='1.0.2',
version='1.0.3',
description='PyGreen',
author='Nicolas Vanhoren',
author_email='nicolas.vanhoren@unknown.com',
Expand Down
16 changes: 8 additions & 8 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from __future__ import unicode_literals
from __future__ import unicode_literals, print_function

import unittest
import pygreen
Expand All @@ -23,27 +23,27 @@ def tearDown(self):
def test_static_get(self):
self.pygreen.set_folder(os.path.join(_folder, "input_static_get"))
value = self.pygreen.get("test.txt")
self.assertEqual(value.strip(), "test")
self.assertEqual(value.strip(), b"test")

def test_mako(self):
self.pygreen.set_folder(os.path.join(_folder, "input_mako"))
value = self.pygreen.get("test.html")
self.assertEqual(value.strip(), "3+2=5")
self.assertEqual(value.strip(), b"3+2=5")

def test_gen(self):
self.pygreen.set_folder(os.path.join(_folder, "input_gen"))
value = self.pygreen.gen_static(_output)
with open(os.path.join(_output, "test.txt")) as _file:
with open(os.path.join(_output, "test.txt"), "rb") as _file:
value = _file.read()
self.assertEqual(value.strip(), "test")
with open(os.path.join(_output, "test.html")) as _file:
self.assertEqual(value.strip(), b"test")
with open(os.path.join(_output, "test.html"), "rb") as _file:
value = _file.read()
self.assertEqual(value.strip(), "3+2=5")
self.assertEqual(value.strip(), b"3+2=5")

def test_markdown(self):
self.pygreen.set_folder(os.path.join(_folder, "input_markdown"))
value = self.pygreen.get("test.html")
self.assertEqual(value.strip(), "<h1>Test</h1>")
self.assertEqual(value.strip(), b"<h1>Test</h1>")

if __name__ == '__main__':
unittest.main()

0 comments on commit 992e1b4

Please sign in to comment.