add a simple test to see if most url endpoints work, fix failures

This commit is contained in:
Dan Colish 2011-04-02 16:40:09 -07:00
parent 053a795f7b
commit 46db573e3c
8 changed files with 53 additions and 10 deletions

View File

@ -6,11 +6,13 @@
<h3>{% trans %}JSON Entrypoint{% endtrans %}</h3>
<p>{% trans %}
This is the entrypoint for the JSON API. If you're interested
in using it head over to the <a href="{{ url_for('help/api') }}">API documentation</a>.
{%- endtrans %}
in using it head over to the {%- endtrans %}
<a href="{{ url_for('static/help', topic='api') }}">{% trans %}API documentation{% endtrans %}</a>.
</p>
<p>{% trans %}Alternatively you can also use the {% endtrans %}
<a href="{{ url_for('xmlrpc/handle_request') }}">XMLRPC</a>{% trans %}service.
{% endtrans %}
</p>
<p>{% trans %}
Alternatively you can also use the <a href="{{ url_for('xmlrpc') }}">XMLRPC</a> service.
{% endtrans %}</p>
</div>
{% endblock %}

View File

@ -6,11 +6,12 @@
<h3>{% trans %}XMLRPC Entrypoint{% endtrans %}</h3>
<p>{% trans %}
This is the entrypoint for the XMLRPC system. If you're interested
in using it head over to the <a href="{{ url_for('help/api') }}">API documentation</a>.
{%- endtrans %}
in using it head over to the {% endtrans %}
<a href="{{ url_for('static/help', topic='api') }}">API {% trans %}documentation{%- endtrans %}</a>.
</p>
<p>
{% trans %}Alternatively you can also use the {% endtrans %}
<a href="{{ url_for('json/handle_request') }}">JSON</a>API.
</p>
<p>{% trans %}
Alternatively you can also use the <a href="{{ url_for('json') }}">JSON</a> API.
{% endtrans %}</p>
</div>
{% endblock %}

4
tests/__init__.py Normal file
View File

@ -0,0 +1,4 @@
from alfajor import APIClient
client = APIClient()
client.configure_in_scope('default')

9
tests/alfajor.ini Normal file
View File

@ -0,0 +1,9 @@
[default-targets]
default+apiclient=wsgi
[default]
wsgi=wsgi
[default+apiclient.wsgi]
server-entry-point = tests.utilities:foo
base_url = http://www.localhost:5001

View File

View File

@ -0,0 +1,17 @@
from tests import client
def test_load_most_urls():
rules = ['/',
'/compare/',
'/all/',
'/all/1/',
'/xmlrpc/',
'/json/',
'/about/',
'/help/',
'/help/json/',
'/colorscheme/',
'/language/es/']
for rule in rules:
client.get(rule)

View File

@ -0,0 +1 @@
from .runner import foo

View File

@ -0,0 +1,9 @@
from werkzeug import create_environ
from lodgeit.application import make_app
foo = make_app('sqlite://', 'NONE', False, True)
def setup():
pass