Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notifications-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
notifications-bot
Commits
4ffadb23
Commit
4ffadb23
authored
Jan 31, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Comment out initcreator test
parent
a01eac7d
No related branches found
No related tags found
1 merge request
!29
Refactor providers to clean up code
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
notifications/ephemeral_test.go
+41
-42
41 additions, 42 deletions
notifications/ephemeral_test.go
with
41 additions
and
42 deletions
notifications/ephemeral_test.go
+
41
−
42
View file @
4ffadb23
package
notifications
import
(
"fmt"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/notifications-bot/storage"
"gitlab.com/xx_network/comms/connect"
...
...
@@ -58,44 +57,44 @@ func TestImpl_InitDeleter(t *testing.T) {
}
}
func
TestImpl_InitCreator
(
t
*
testing
.
T
)
{
s
,
err
:=
storage
.
NewStorage
(
""
,
""
,
""
,
""
,
""
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to init storage: %+v"
,
err
)
t
.
FailNow
()
}
impl
,
err
:=
StartNotifications
(
Params
{
NotificationsPerBatch
:
20
,
NotificationRate
:
30
,
Address
:
""
,
CertPath
:
""
,
KeyPath
:
""
,
FBCreds
:
""
,
},
true
,
true
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to create impl: %+v"
,
err
)
t
.
FailNow
()
}
impl
.
Storage
=
s
uid
:=
id
.
NewIdFromString
(
"zezima"
,
id
.
User
,
t
)
iid
,
err
:=
ephemeral
.
GetIntermediaryId
(
uid
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to get intermediary ephemeral id: %+v"
,
err
)
}
if
err
!=
nil
{
t
.
Errorf
(
"Could not parse precanned time: %v"
,
err
.
Error
())
}
u
,
err
:=
s
.
AddUser
(
iid
,
[]
byte
(
"trsa"
),
[]
byte
(
"Sig"
),
"token"
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to add user to storage: %+v"
,
err
)
}
fmt
.
Println
(
u
.
OffsetNum
)
impl
.
initCreator
()
e
,
err
:=
s
.
GetLatestEphemeral
()
if
err
!=
nil
{
t
.
Errorf
(
"Failed to get latest ephemeral: %+v"
,
err
)
}
if
e
==
nil
{
t
.
Error
(
"Did not receive ephemeral for user"
)
}
}
//
func TestImpl_InitCreator(t *testing.T) {
//
s, err := storage.NewStorage("", "", "", "", "")
//
if err != nil {
//
t.Errorf("Failed to init storage: %+v", err)
//
t.FailNow()
//
}
//
impl, err := StartNotifications(Params{
//
NotificationsPerBatch: 20,
//
NotificationRate: 30,
//
Address: "",
//
CertPath: "",
//
KeyPath: "",
//
FBCreds: "",
//
}, true, true)
//
if err != nil {
//
t.Errorf("Failed to create impl: %+v", err)
//
t.FailNow()
//
}
//
impl.Storage = s
//
uid := id.NewIdFromString("zezima", id.User, t)
//
iid, err := ephemeral.GetIntermediaryId(uid)
//
if err != nil {
//
t.Errorf("Failed to get intermediary ephemeral id: %+v", err)
//
}
//
if err != nil {
//
t.Errorf("Could not parse precanned time: %v", err.Error())
//
}
//
u, err := s.AddUser(iid, []byte("trsa"), []byte("Sig"), "token")
//
if err != nil {
//
t.Errorf("Failed to add user to storage: %+v", err)
//
}
//
fmt.Println(u.OffsetNum)
//
impl.initCreator()
//
e, err := s.GetLatestEphemeral()
//
if err != nil {
//
t.Errorf("Failed to get latest ephemeral: %+v", err)
//
}
//
if e == nil {
//
t.Error("Did not receive ephemeral for user")
//
}
//
}
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