Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
elixxir
client
Commits
60207767
Commit
60207767
authored
3 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Add basic json test, fix tags in loadJson
parent
9afeb516
No related branches found
No related tags found
3 merge requests
!231
Revert "Update store to print changes to the partners list"
,
!187
Xx 3829/triggers
,
!181
Xx 3818/jsonbackup
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backup/jsonStorage.go
+1
-1
1 addition, 1 deletion
backup/jsonStorage.go
backup/jsonStorage_test.go
+22
-0
22 additions, 0 deletions
backup/jsonStorage_test.go
with
23 additions
and
1 deletion
backup/jsonStorage.go
+
1
−
1
View file @
60207767
...
...
@@ -21,7 +21,7 @@ func storeJson(json string, kv *versioned.KV) error {
}
func
loadJson
(
kv
*
versioned
.
KV
)
string
{
obj
,
err
:=
kv
.
Get
(
password
StorageKey
,
password
StorageVersion
)
obj
,
err
:=
kv
.
Get
(
json
StorageKey
,
json
StorageVersion
)
if
err
!=
nil
{
return
""
}
...
...
This diff is collapsed.
Click to expand it.
backup/jsonStorage_test.go
0 → 100644
+
22
−
0
View file @
60207767
package
backup
import
(
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/ekv"
"testing"
)
func
Test_storeJson_loadJson
(
t
*
testing
.
T
)
{
kv
:=
versioned
.
NewKV
(
make
(
ekv
.
Memstore
))
json
:=
"{'data': {'one': 1}}"
err
:=
storeJson
(
json
,
kv
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to store JSON: %+v"
,
err
)
}
loaded
:=
loadJson
(
kv
)
if
loaded
!=
json
{
t
.
Errorf
(
"Did not receive expected data from KV.
\n\t
Expected: %s, Received: %s
\n
"
,
json
,
loaded
)
}
}
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