Renamed OpenPhoto to Trovebox
This commit is contained in:
parent
57b593d245
commit
6f70330994
30 changed files with 368 additions and 365 deletions
|
@ -1,6 +1,6 @@
|
|||
import logging
|
||||
|
||||
import openphoto
|
||||
import trovebox
|
||||
from tests.functional import test_base
|
||||
|
||||
class TestFramework(test_base.TestBase):
|
||||
|
@ -16,8 +16,8 @@ class TestFramework(test_base.TestBase):
|
|||
"""
|
||||
API v0 has a special hello world message
|
||||
"""
|
||||
client = openphoto.OpenPhoto(config_file=self.config_file,
|
||||
api_version=0)
|
||||
client = trovebox.Trovebox(config_file=self.config_file,
|
||||
api_version=0)
|
||||
result = client.get("hello.json")
|
||||
self.assertEqual(result['message'],
|
||||
"Hello, world! This is version zero of the API!")
|
||||
|
@ -28,8 +28,8 @@ class TestFramework(test_base.TestBase):
|
|||
For all API versions >0, we get a generic hello world message
|
||||
"""
|
||||
for api_version in range(1, test_base.get_test_server_api() + 1):
|
||||
client = openphoto.OpenPhoto(config_file=self.config_file,
|
||||
api_version=api_version)
|
||||
client = trovebox.Trovebox(config_file=self.config_file,
|
||||
api_version=api_version)
|
||||
result = client.get("hello.json")
|
||||
self.assertEqual(result['message'], "Hello, world!")
|
||||
self.assertEqual(result['result']['__route__'],
|
||||
|
@ -40,8 +40,8 @@ class TestFramework(test_base.TestBase):
|
|||
If the API version is unspecified,
|
||||
we get a generic hello world message.
|
||||
"""
|
||||
client = openphoto.OpenPhoto(config_file=self.config_file,
|
||||
api_version=None)
|
||||
client = trovebox.Trovebox(config_file=self.config_file,
|
||||
api_version=None)
|
||||
result = client.get("hello.json")
|
||||
self.assertEqual(result['message'], "Hello, world!")
|
||||
self.assertEqual(result['result']['__route__'], "/hello.json")
|
||||
|
@ -51,7 +51,8 @@ class TestFramework(test_base.TestBase):
|
|||
If the API version is unsupported, we should get an error
|
||||
(ValueError, since the returned 404 HTML page is not valid JSON)
|
||||
"""
|
||||
client = openphoto.OpenPhoto(config_file=self.config_file,
|
||||
api_version=openphoto.LATEST_API_VERSION + 1)
|
||||
with self.assertRaises(openphoto.OpenPhoto404Error):
|
||||
version = trovebox.LATEST_API_VERSION + 1
|
||||
client = trovebox.Trovebox(config_file=self.config_file,
|
||||
api_version=version)
|
||||
with self.assertRaises(trovebox.Trovebox404Error):
|
||||
client.get("hello.json")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue