Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
9b42afa9
Commit
9b42afa9
authored
8 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
implement first simple unit tests
parent
aa5b8b84
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tests/opendht_tests.py
+22
-0
22 additions, 0 deletions
python/tests/opendht_tests.py
with
22 additions
and
0 deletions
python/tests/opendht_tests.py
0 → 100644
+
22
−
0
View file @
9b42afa9
import
unittest
import
opendht
as
dht
class
OpenDhtTester
(
unittest
.
TestCase
):
# test that DhtRunner can be instatiated and deleted without throwing
def
test_instance
(
self
):
for
i
in
range
(
10
):
r
=
dht
.
DhtRunner
()
r
.
run
()
del
r
# test that bootstraping works (raw address)
def
test_bootstrap
(
self
):
a
=
dht
.
DhtRunner
()
a
.
run
()
b
=
dht
.
DhtRunner
()
b
.
run
()
self
.
assertTrue
(
b
.
bootstrap
(
a
.
getBound
()))
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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