Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pops
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
pops
Commits
c69683dc
Commit
c69683dc
authored
9 years ago
by
Stauros Kroustouris
Browse files
Options
Downloads
Patches
Plain Diff
tests
parent
c14c76e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.py
+39
-12
39 additions, 12 deletions
tests.py
with
39 additions
and
12 deletions
tests.py
+
39
−
12
View file @
c69683dc
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run
"
manage.py test
"
.
from
django.test
import
TestCase
from
django.test
import
Client
Replace this with more appropriate tests for your application.
"""
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
class
ApiTest
(
TestCase
):
def
setUp
(
self
):
self
.
client
=
Client
()
def
test_api_urls
(
self
):
'''
Check if api urls exist
'''
response
=
self
.
client
.
get
(
reverse
(
'
api:pops
'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_import_models
(
self
):
'''
Check if needed models exist
'''
from
network.models
import
PeerIfces
,
PeerSite
class
SimpleTest
(
TestCase
):
def
test_basic_addition
(
self
):
"""
Tests that 1 + 1 always equals 2.
"""
self
.
assertEqual
(
1
+
1
,
2
)
def
test_static
(
self
):
'''
Check if static files exist
'''
from
django.contrib.staticfiles
import
finders
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/customer-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/grnet-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/commercial-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/pin-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/core-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/access-optical-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/access-l2-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/distribution-legend.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/pass-through-thumb.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/icons/unknown-thumb.png
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
bootstrap/js/bootstrap.js
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/js/gmaps.js
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/js/underscore-min.js
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
bootstrap/css/bootstrap.min.css
'
),
None
)
self
.
assertIsNot
(
finders
.
find
(
'
pops/css/maps.css
'
),
None
)
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