Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
danet
bio-rd
Commits
61c6de9f
Commit
61c6de9f
authored
6 years ago
by
Maximilian Wilhelm
Browse files
Options
Downloads
Patches
Plain Diff
Add more tests for contributing ASNs.
Signed-off-by:
Maximilian Wilhelm
<
max@sdn.clinic
>
parent
71458b44
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
routingtable/contributing_asn_list_test.go
+24
-5
24 additions, 5 deletions
routingtable/contributing_asn_list_test.go
with
24 additions
and
5 deletions
routingtable/contributing_asn_list_test.go
+
24
−
5
View file @
61c6de9f
...
...
@@ -24,7 +24,7 @@ func TestFancy(t *testing.T) {
{
runCmd
:
func
()
{
c
.
Add
(
41981
)
},
expect
:
func
()
bool
{
return
c
.
IsContributingASN
(
41981
)
},
msg
:
"AS41981 should be contributing"
,
msg
:
"AS41981 should be contributing
.
"
,
},
{
runCmd
:
func
()
{
c
.
Remove
(
41981
)
},
...
...
@@ -36,30 +36,49 @@ func TestFancy(t *testing.T) {
{
runCmd
:
func
()
{
c
.
Add
(
41981
)
},
expect
:
func
()
bool
{
return
c
.
IsContributingASN
(
41981
)
},
msg
:
"AS41981 should be contributing"
,
msg
:
"AS41981 should be contributing
.
"
,
},
{
runCmd
:
func
()
{
c
.
Add
(
201701
)
},
expect
:
func
()
bool
{
return
c
.
IsContributingASN
(
41981
)
},
msg
:
"AS201701 should be contributing"
,
msg
:
"AS201701 should be contributing
.
"
,
},
// Add AS41981 2nd time
{
runCmd
:
func
()
{
c
.
Add
(
41981
)
},
expect
:
func
()
bool
{
return
c
.
IsContributingASN
(
41981
)
},
msg
:
"AS41981 should be still contributing"
,
msg
:
"AS41981 should be still contributing
.
"
,
},
{
runCmd
:
func
()
{},
expect
:
func
()
bool
{
return
c
.
contributingASNs
[
0
]
.
asn
==
41981
},
msg
:
"AS41981 is first ASN in list"
,
msg
:
"AS41981 is first ASN in list
.
"
,
},
{
runCmd
:
func
()
{
fmt
.
Printf
(
"%+v"
,
c
.
contributingASNs
)
},
expect
:
func
()
bool
{
return
c
.
contributingASNs
[
0
]
.
count
==
2
},
msg
:
"AS41981 should be present twice."
,
},
// Remove 2nd AS41981
{
runCmd
:
func
()
{
c
.
Remove
(
41981
)
},
expect
:
func
()
bool
{
return
c
.
IsContributingASN
(
41981
)
},
msg
:
"AS41981 should still be contributing."
,
},
{
runCmd
:
func
()
{},
expect
:
func
()
bool
{
return
c
.
contributingASNs
[
0
]
.
count
==
1
},
msg
:
"S41981 should be present once."
,
},
// Remove AS201701
{
runCmd
:
func
()
{
c
.
Remove
(
201701
)
},
expect
:
func
()
bool
{
return
!
c
.
IsContributingASN
(
201701
)
},
msg
:
"AS201701 shouldn't be contributing no more."
,
},
}
for
i
,
test
:=
range
tests
{
...
...
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