diff options
Diffstat (limited to 'src/testarchive')
| -rw-r--r-- | src/testarchive/__init__.py | 0 | ||||
| -rw-r--r-- | src/testarchive/models.py | 3 | ||||
| -rw-r--r-- | src/testarchive/templates/emitter.html | 11 | ||||
| -rw-r--r-- | src/testarchive/templates/emitter.txt | 4 | ||||
| -rw-r--r-- | src/testarchive/templates/emitter.xhtml | 3 | ||||
| -rw-r--r-- | src/testarchive/tests.py | 23 | ||||
| -rw-r--r-- | src/testarchive/urls.py | 7 | ||||
| -rw-r--r-- | src/testarchive/views.py | 8 |
8 files changed, 59 insertions, 0 deletions
diff --git a/src/testarchive/__init__.py b/src/testarchive/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/testarchive/__init__.py diff --git a/src/testarchive/models.py b/src/testarchive/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/src/testarchive/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/src/testarchive/templates/emitter.html b/src/testarchive/templates/emitter.html new file mode 100644 index 00000000..4c843aa3 --- /dev/null +++ b/src/testarchive/templates/emitter.html @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <body> + <h1>{{ resource_name }}</h1> + <p>{{ resource_doc }}</p> + <pre> +{% include 'emitter.txt' %} </pre> + </body> +</html>
\ No newline at end of file diff --git a/src/testarchive/templates/emitter.txt b/src/testarchive/templates/emitter.txt new file mode 100644 index 00000000..3bf094c6 --- /dev/null +++ b/src/testarchive/templates/emitter.txt @@ -0,0 +1,4 @@ +{% autoescape off %}HTTP Status {{ status }} +{% for key, val in headers.items %}{{ key }}: {{ val }} +{% endfor %} +{{ content }}{% endautoescape %}
\ No newline at end of file diff --git a/src/testarchive/templates/emitter.xhtml b/src/testarchive/templates/emitter.xhtml new file mode 100644 index 00000000..d9fb3ce9 --- /dev/null +++ b/src/testarchive/templates/emitter.xhtml @@ -0,0 +1,3 @@ +HTML: + +{{ content }}
\ No newline at end of file diff --git a/src/testarchive/tests.py b/src/testarchive/tests.py new file mode 100644 index 00000000..2aaf1bab --- /dev/null +++ b/src/testarchive/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 3) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/src/testarchive/urls.py b/src/testarchive/urls.py new file mode 100644 index 00000000..81aa0fa8 --- /dev/null +++ b/src/testarchive/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls.defaults import patterns +from testarchive.views import RootResource + + +urlpatterns = patterns('', + (r'^$', RootResource), +) diff --git a/src/testarchive/views.py b/src/testarchive/views.py new file mode 100644 index 00000000..a7812dc3 --- /dev/null +++ b/src/testarchive/views.py @@ -0,0 +1,8 @@ +from rest.resource import Resource + +class RootResource(Resource): + """This is my docstring + """ + + def handle_get(self, headers={}, *args, **kwargs): + return (200, {'Name': 'Test', 'Value': 1}, {'Location': 'BLAH'}) |
