forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at storing user settings separately #2896
- Loading branch information
1 parent
151a104
commit 6b7b35a
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/github.com/getlantern/flashlight/settings/settings_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package settings | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBootstrapSettings(t *testing.T) { | ||
version := "test" | ||
revisionDate := "test" | ||
buildDate := "test" | ||
Load(version, revisionDate, buildDate) | ||
|
||
assert.Equal(t, settings.AutoLaunch, true, "Should be set to auto launch") | ||
|
||
// Reset the variables for loading the yaml. | ||
name = "test.yaml" | ||
dir = "." | ||
//path := filepath.Join(dir, "test.yaml") | ||
|
||
Load(version, revisionDate, buildDate) | ||
|
||
assert.Equal(t, settings.AutoLaunch, false, "Should not be set to auto launch") | ||
/* | ||
set := &Settings{ | ||
Version: version, | ||
BuildDate: buildDate, | ||
RevisionDate: revisionDate, | ||
AutoReport: true, | ||
AutoLaunch: true, | ||
ProxyAll: false, | ||
} | ||
if bytes, err := yaml.Marshal(set); err != nil { | ||
t.Fail() | ||
} else if err := ioutil.WriteFile(path, bytes, 0644); err != nil { | ||
t.Fail() | ||
} | ||
*/ | ||
} |