gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-backoffice] 30/31: mock and nose for testing


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] 30/31: mock and nose for testing
Date: Thu, 04 Jan 2018 18:09:53 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository backoffice.

commit 8ce17eb2544413f924fdd07fa0e097952dee9cf5
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Dec 11 16:33:56 2017 +0100

    mock and nose for testing
---
 Makefile.in               | 3 +--
 setup.py                  | 2 ++
 talerblog/blog/blog.py    | 4 ++--
 talerblog/blog/content.py | 1 +
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 508f141..b80131d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,5 +49,4 @@ install: $(templates) install-data
 .PHONY: check
 check:
        @export address@hidden@/talerblog/tests.conf; \
-        export address@hidden@/lib/address@hidden@/site-packages; \
-        python3 talerblog/tests.py
+        python3 setup.py test
diff --git a/setup.py b/setup.py
index 4c76f73..b7fd69d 100755
--- a/setup.py
+++ b/setup.py
@@ -9,6 +9,8 @@ setup(name='talerblog',
       license='GPL',
       packages=find_packages(),
       install_requires=["Flask>=0.10"],
+      tests_require=["nose", "mock"],
+      test_suite="nose.collector",
       package_data={
           '':[
               "blog/templates/*.html",
diff --git a/talerblog/blog/blog.py b/talerblog/blog/blog.py
index 650edd0..8a48883 100644
--- a/talerblog/blog/blog.py
+++ b/talerblog/blog/blog.py
@@ -27,10 +27,10 @@ import base64
 import requests
 import flask
 from talerblog.talerconfig import TalerConfig
-from talerblog.helpers import (make_url, \
+from ..helpers import (make_url, \
     expect_parameter, join_urlparts, \
     get_query_string, backend_error)
-from talerblog.blog.content import (ARTICLES, \
+from ..blog.content import (ARTICLES, \
     get_article_file, get_image_file)
 
 LOGGER = logging.getLogger(__name__)
diff --git a/talerblog/blog/content.py b/talerblog/blog/content.py
index 3202a50..1ddbf46 100644
--- a/talerblog/blog/content.py
+++ b/talerblog/blog/content.py
@@ -52,6 +52,7 @@ def add_from_html(resource_name, teaser_paragraph=0, 
title=None):
     """
     res = resource_stream("talerblog", resource_name)
     soup = BeautifulSoup(res, 'html.parser')
+    res.close()
     if title is None:
         title_el = soup.find("h1", attrs={"class":["chapter", "unnumbered"]})
         if title_el is None:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]