Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
juga
sbws
Commits
69bb621e
Commit
69bb621e
authored
6 years ago
by
juga
Committed by
Matt Traudt
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove tests data v3bw file and refactor test
reading from the file created in the same test
parent
b4bfea6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/unit/lib/data/v3bw/20180425_131057.v3bw
+0
-10
0 additions, 10 deletions
tests/unit/lib/data/v3bw/20180425_131057.v3bw
tests/unit/lib/test_v3bwfile.py
+10
-15
10 additions, 15 deletions
tests/unit/lib/test_v3bwfile.py
with
10 additions
and
25 deletions
tests/unit/lib/data/v3bw/20180425_131057.v3bw
deleted
100644 → 0
+
0
−
10
View file @
b4bfea6e
1523974147
version=1.1.0
earliest_bandwidth=2018-04-16T14:09:07
file_created=2018-04-25T13:10:57
generator_started=2018-04-16T14:09:05
latest_bandwidth=2018-04-17T14:09:07
software=sbws
software_version=0.6.1-dev
====
bw=54 error_circ=0 error_misc=0 error_stream=1 master_key_ed25519=g+Shk00y9Md0hg1S6ptnuc/wWKbADBgdjT0Kg+TSF3s nick=A node_id=$AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA rtt=456 success=1 time=2018-04-17T14:09:07
This diff is collapsed.
Click to expand it.
tests/unit/lib/test_v3bwfile.py
+
10
−
15
View file @
69bb621e
...
...
@@ -112,20 +112,6 @@ def test_v3bwline_from_results_file(datadir):
assert
bwl_str
==
str
(
bwl
)
def
test_v3bwfile
(
datadir
,
tmpdir
):
"""
Test generate v3bw file (including relay_lines).
"""
# at some point this should be obtained from conftest
v3bw
=
datadir
.
read
(
'
v3bw/20180425_131057.v3bw
'
)
results
=
load_result_file
(
str
(
datadir
.
join
(
"
results.txt
"
)))
header
=
V3BWHeader
(
timestamp_l
,
file_created
=
file_created
,
generator_started
=
generator_started
,
earliest_bandwidth
=
earliest_bandwidth
)
bwls
=
[
V3BWLine
.
from_results
(
results
[
fp
])
for
fp
in
results
]
f
=
V3BWFile
(
header
,
bwls
)
assert
v3bw
==
str
(
f
)
def
test_from_arg_results
(
datadir
,
tmpdir
,
conf
,
args
):
results
=
load_result_file
(
str
(
datadir
.
join
(
"
results.txt
"
)))
expected_header
=
V3BWHeader
(
timestamp_l
,
...
...
@@ -136,7 +122,6 @@ def test_from_arg_results(datadir, tmpdir, conf, args):
v3bwfile
=
V3BWFile
.
from_arg_results
(
args
,
conf
,
results
)
assert
str
(
expected_f
)[
1
:]
==
str
(
v3bwfile
)[
1
:]
output
=
os
.
path
.
join
(
args
.
output
,
now_fname
())
print
(
output
)
v3bwfile
.
write
(
output
)
...
...
@@ -146,3 +131,13 @@ def test_from_arg_results_write(datadir, tmpdir, conf, args):
output
=
os
.
path
.
join
(
args
.
output
,
now_fname
())
v3bwfile
.
write
(
output
)
assert
os
.
path
.
isfile
(
output
)
def
test_from_arg_results_write_read
(
datadir
,
tmpdir
,
conf
,
args
):
results
=
load_result_file
(
str
(
datadir
.
join
(
"
results.txt
"
)))
v3bwfile
=
V3BWFile
.
from_arg_results
(
args
,
conf
,
results
)
output
=
os
.
path
.
join
(
args
.
output
,
now_fname
())
v3bwfile
.
write
(
output
)
with
open
(
output
)
as
fd
:
v3bw
=
fd
.
read
()
assert
v3bw
==
str
(
v3bwfile
)
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