Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
sbws
Commits
14dcf633
Commit
14dcf633
authored
May 22, 2018
by
juga
Committed by
Matt Traudt
Jun 05, 2018
Browse files
Fix software and software_version postions
they do not need to be in 3rd and 4th posstions.
parent
055271e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
sbws/lib/v3bwfile.py
View file @
14dcf633
...
@@ -14,10 +14,11 @@ K_SEP_V110 = '='
...
@@ -14,10 +14,11 @@ K_SEP_V110 = '='
KV_SEP_V110
=
'
\n
'
KV_SEP_V110
=
'
\n
'
K_SEP_V200
=
' '
K_SEP_V200
=
' '
KV_SEP_V200
=
' '
KV_SEP_V200
=
' '
ORDERED_KV
=
[
'version'
,
'software'
,
'software_version'
]
ORDERED_KV
=
[
'version'
]
ORDERED_K
=
[
'timestamp'
,
'version'
,
'software'
,
'software_version'
]
ORDERED_K
=
[
'timestamp'
,
'version'
]
ALLOWED_K
=
ORDERED_KV
+
[
'lastest_bandwidth'
,
'file_created'
,
ALLOWED_K
=
ORDERED_KV
+
[
'software'
,
'software_version'
,
'lastest_bandwidth'
,
'earliest_bandwidth'
,
'generator_started'
]
'file_created'
,
'earliest_bandwidth'
,
'generator_started'
]
TERMINATOR
=
'===='
TERMINATOR
=
'===='
LINE_TERMINATOR
=
TERMINATOR
+
LINE_SEP
LINE_TERMINATOR
=
TERMINATOR
+
LINE_SEP
...
...
tests/unit/lib/test_v3bwfile.py
View file @
14dcf633
...
@@ -11,8 +11,8 @@ software_l = K_SEP_V110.join(['software', 'sbws'])
...
@@ -11,8 +11,8 @@ software_l = K_SEP_V110.join(['software', 'sbws'])
software_version_l
=
K_SEP_V110
.
join
([
'software_version'
,
version
])
software_version_l
=
K_SEP_V110
.
join
([
'software_version'
,
version
])
file_created
=
'2018-04-25T13:10:57'
file_created
=
'2018-04-25T13:10:57'
file_created_l
=
K_SEP_V110
.
join
([
'file_created'
,
file_created
])
file_created_l
=
K_SEP_V110
.
join
([
'file_created'
,
file_created
])
header_ls
=
[
timestamp_l
,
version_l
,
software
_l
,
software_
version_
l
,
header_ls
=
[
timestamp_l
,
version_l
,
file_created
_l
,
software_l
,
file_created
_l
,
TERMINATOR
]
software_version
_l
,
TERMINATOR
]
header_str
=
LINE_SEP
.
join
(
header_ls
)
+
LINE_SEP
header_str
=
LINE_SEP
.
join
(
header_ls
)
+
LINE_SEP
lastest_bandwidth
=
'2018-04-17T14:09:07'
lastest_bandwidth
=
'2018-04-17T14:09:07'
lastest_bandwidth_l
=
K_SEP_V110
.
join
([
'lastest_bandwidth'
,
lastest_bandwidth
])
lastest_bandwidth_l
=
K_SEP_V110
.
join
([
'lastest_bandwidth'
,
lastest_bandwidth
])
...
@@ -22,9 +22,10 @@ earliest_bandwidth_l = K_SEP_V110.join(['earliest_bandwidth',
...
@@ -22,9 +22,10 @@ earliest_bandwidth_l = K_SEP_V110.join(['earliest_bandwidth',
generator_started
=
'2018-04-16T14:09:05'
generator_started
=
'2018-04-16T14:09:05'
generator_started_l
=
K_SEP_V110
.
join
([
'generator_started'
,
generator_started_l
=
K_SEP_V110
.
join
([
'generator_started'
,
generator_started
])
generator_started
])
header_extra_ls
=
[
timestamp_l
,
version_l
,
software_l
,
software_version_l
,
header_extra_ls
=
[
timestamp_l
,
version_l
,
earliest_bandwidth_l
,
file_created_l
,
generator_started_l
,
earliest_bandwidth_l
,
file_created_l
,
generator_started_l
,
lastest_bandwidth_l
,
TERMINATOR
]
lastest_bandwidth_l
,
software_l
,
software_version_l
,
TERMINATOR
]
header_extra_str
=
LINE_SEP
.
join
(
header_extra_ls
)
+
LINE_SEP
header_extra_str
=
LINE_SEP
.
join
(
header_extra_ls
)
+
LINE_SEP
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment