[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
- [GNUnet-SVN] [taler-backoffice] 03/31: bootstrap/wsgi/launcher, (continued)
- [GNUnet-SVN] [taler-backoffice] 03/31: bootstrap/wsgi/launcher, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 06/31: base template, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 18/31: naming leftovers, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 22/31: pacify PEP checkers, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 21/31: linting the launcher, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 28/31: survey in side bar, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 14/31: missing templates, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 11/31: actual blog logic, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 05/31: m4, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 09/31: __init__, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 30/31: mock and nose for testing,
gnunet <=
- [GNUnet-SVN] [taler-backoffice] 29/31: fix demobar, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 31/31: repo description, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 17/31: right templates dir, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 16/31: testcase, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 12/31: config parser, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 20/31: mostly linted, gnunet, 2018/01/04
- [GNUnet-SVN] [taler-backoffice] 08/31: adding articles, gnunet, 2018/01/04