Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
13199f0f
Commit
13199f0f
authored
14 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
set up testing infrastructure for other data formats
parent
f5ed804c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
helios/tests.py
+23
-7
23 additions, 7 deletions
helios/tests.py
with
23 additions
and
7 deletions
helios/tests.py
+
23
−
7
View file @
13199f0f
...
...
@@ -217,13 +217,7 @@ class CastVoteModelTests(TestCase):
## Black box tests
##
class
LegacyElectionBlackboxTests
(
TestCase
):
fixtures
=
[
'
legacy-data.json
'
]
EXPECTED_ELECTION_FILE
=
'
helios/fixtures/legacy-election-expected.json
'
EXPECTED_VOTERS_FILE
=
'
helios/fixtures/legacy-election-voters-expected.json
'
EXPECTED_TRUSTEES_FILE
=
'
helios/fixtures/legacy-trustees-expected.json
'
EXPECTED_BALLOTS_FILE
=
'
helios/fixtures/legacy-ballots-expected.json
'
class
DataFormatBlackboxTests
(
object
):
def
setUp
(
self
):
self
.
election
=
models
.
Election
.
objects
.
all
()[
0
]
...
...
@@ -248,6 +242,28 @@ class LegacyElectionBlackboxTests(TestCase):
response
=
self
.
client
.
get
(
"
/helios/elections/%s/ballots/
"
%
self
.
election
.
uuid
,
follow
=
False
)
self
.
assertEqualsToFile
(
response
,
self
.
EXPECTED_BALLOTS_FILE
)
## now we have a set of fixtures and expected results for various formats
## note how TestCase is used as a "mixin" here, so that the generic DataFormatBlackboxTests
## does not register as a set of test cases to run, but each concrete data format does.
class
LegacyElectionBlackboxTests
(
DataFormatBlackboxTests
,
TestCase
):
fixtures
=
[
'
legacy-data.json
'
]
EXPECTED_ELECTION_FILE
=
'
helios/fixtures/legacy-election-expected.json
'
EXPECTED_VOTERS_FILE
=
'
helios/fixtures/legacy-election-voters-expected.json
'
EXPECTED_TRUSTEES_FILE
=
'
helios/fixtures/legacy-trustees-expected.json
'
EXPECTED_BALLOTS_FILE
=
'
helios/fixtures/legacy-ballots-expected.json
'
class
V3_1_ElectionBlackboxTests
(
DataFormatBlackboxTests
,
TestCase
):
fixtures
=
[
'
v3.1-data.json
'
]
EXPECTED_ELECTION_FILE
=
'
helios/fixtures/v3.1-election-expected.json
'
EXPECTED_VOTERS_FILE
=
'
helios/fixtures/v3.1-election-voters-expected.json
'
EXPECTED_TRUSTEES_FILE
=
'
helios/fixtures/v3.1-trustees-expected.json
'
EXPECTED_BALLOTS_FILE
=
'
helios/fixtures/v3.1-ballots-expected.json
'
##
## overall operation of the system
##
class
ElectionBlackboxTests
(
TestCase
):
fixtures
=
[
'
users.json
'
,
'
election.json
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment