Statistics
| Branch: | Tag: | Revision:

root / api / tests.py @ 894f6b7e

History | View | Annotate | Download (794 Bytes)

1
#
2
# Unit Tests for api
3
#
4
# Provides automated tests for db module
5
#
6
# Copyright 2010 Greek Research and Technology Network
7
#
8

    
9
from django.test import TestCase
10
from django.test.client import Client
11

    
12
class APITestCase(TestCase):
13
    def setUp(self):
14
        pass
15

    
16
    def testAPIVersion(self):
17
        c = Client()
18
        response = c.get('/api/v1.0/')
19
        # Check that the response is 200 OK.
20
        self.assertEqual(response.status_code, 200)
21
        expected = '{\n    "version": {\n        "status": "CURRENT", \n        "wadl": "http://docs.rackspacecloud.com/servers/api/v1.0/application.wadl", \n        "docURL": "http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide-20090714.pdf ", \n        "id": "v1.0"\n    }\n}'
22
        self.assertEqual(response.content, expected)
23