Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More test coverage and cache regions!
- Loading branch information
Showing
6 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from tests import * | ||
|
||
from riotoustools import main | ||
|
||
class DayZeroDefaultViewTest(TestCase): | ||
def setUp(self): | ||
self.app = TestApp(main({}, **settings)) | ||
|
||
def test_default_root(self): | ||
response = self.app.get('/', status=200) | ||
print response.body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from tests import * | ||
|
||
from riotoustools.models.user import User | ||
from riotoustools.models.dayzero import DayZeroList | ||
from riotoustools.models.dayzero import DayZeroItem | ||
|
||
class DayZeroModelTest(TestCase): | ||
def setUp(self): | ||
self.user = User('name', 'email', 'password') | ||
|
||
self.dzl = DayZeroList('name') | ||
self.dzl.id = 1 | ||
self.dzl.user = self.user | ||
self.dzl.owner_id = self.user.id | ||
|
||
def test_dayzero_acl(self): | ||
self.assertEquals(self.dzl.__acl__[0][1], 'owner:{0}'.format(self.user.id)) | ||
|
||
def test_dayzero_str(self): | ||
self.assertEquals(str(self.dzl), 'DayZeroList(id={0}, owner_id={1})'.format(self.dzl.id, self.dzl.user.id)) | ||
|
||
def test_dayzero_repr(self): | ||
self.assertEquals(repr(self.dzl), 'DayZeroList(id={0}, owner_id={1})'.format(self.dzl.id, self.dzl.user.id)) | ||
|
||
def test_dayzero_item_acl(self): | ||
self.dzl.items.append(DayZeroItem('test')) | ||
self.assertEquals(self.dzl.items[0].__acl__[0][1], 'owner:{0}'.format(self.user.id)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from tests import * | ||
|
||
from riotoustools.models.user import User | ||
from riotoustools.models.lifecal import LifeCal | ||
|
||
class DayZeroModelTest(TestCase): | ||
def setUp(self): | ||
self.user = User('name', 'email', 'password') | ||
|
||
self.lifecal = LifeCal() | ||
self.lifecal.id = 1 | ||
self.lifecal.user = self.user | ||
self.lifecal.owner_id = self.user.id | ||
|
||
def test_lifecal_acl(self): | ||
self.assertEquals(self.lifecal.__acl__[0][1], 'owner:{0}'.format(self.user.id)) | ||
|