Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Fixfix
Browse files Browse the repository at this point in the history
  • Loading branch information
moschlar committed Jul 3, 2013
1 parent 42f82c0 commit 3a77ba0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion migration/versions/3a8c537e6090_test_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def upgrade():

op.alter_column('tests', 'visible', nullable=True)

op.add_column('tests', sa.Column('visibility',
op.add_column('tests', 'visiblity',
sa.Enum('invisible', 'only_result', 'only_data', 'visible', name='test_visibility'),
nullable=False)

Expand Down
8 changes: 8 additions & 0 deletions sauce/model/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ def event(self):
def teacher(self):
return self._teacher or self.sheet.teacher

@property
def visible_tests(self):
return [test for test in self.tests if test.visibility == 'visible']

@property
def invisible_tests(self):
return [test for test in self.tests if test.visibility == 'invisible']

@property
def start_time(self):
if self._start_time:
Expand Down
12 changes: 7 additions & 5 deletions sauce/tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_run_c(self):
if not compilation or compilation.result:
testruns = [testrun for testrun in r.test()]
for testrun in testruns:
self.assertTrue(testrun, 'C testrun failed')
self.assertTrue(testrun.result, 'C testrun failed')

def test_run_python(self):
'''Test runner with a python submission'''
Expand All @@ -110,7 +110,7 @@ def test_run_python(self):
if not compilation or compilation.result:
testruns = [testrun for testrun in r.test()]
for testrun in testruns:
self.assertTrue(testrun, 'Python testrun failed')
self.assertTrue(testrun.result, 'Python testrun failed')

def test_run_java(self):
'''Test runner with java submission'''
Expand All @@ -133,7 +133,7 @@ def test_run_java(self):
if not compilation or compilation.result:
testruns = [testrun for testrun in r.test()]
for testrun in testruns:
self.assertTrue(testrun, 'Java testrun failed')
self.assertTrue(testrun.result, 'Java testrun failed')

def test_run_fail(self):
'''Test runner with a incorrect output'''
Expand All @@ -150,7 +150,8 @@ def test_run_fail(self):
if not compilation or compilation.result:
testruns = [testrun for testrun in r.test()]
for testrun in testruns:
self.assertFalse(testrun, 'Wrong testrun failed')
print testrun
self.assertFalse(testrun.result, 'Wrong testrun failed')

def test_run_timeout(self):
'''Test runner with an always reached timeout value'''
Expand All @@ -169,6 +170,7 @@ def test_run_timeout(self):
if not compilation or compilation.result:
testruns = [testrun for testrun in r.test()]
for testrun in testruns:
self.assertFalse(testrun, 'Timeout testrun failed')
print testrun
self.assertFalse(testrun.result, 'Timeout testrun failed')

#TODO: Test running application that does not react to SIGTERM

0 comments on commit 3a77ba0

Please sign in to comment.