Skip to content

Commit

Permalink
Ensure user config is complete in submit tests
Browse files Browse the repository at this point in the history
The submit command tests would fail spuriously if we
validate that the api url is set (i.e. that the CLI is configured).
  • Loading branch information
Katrina Owen committed Dec 26, 2018
1 parent 05096a3 commit 33cd3c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/submit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestSubmitNonExistentFile(t *testing.T) {
v := viper.New()
v.Set("token", "abc123")
v.Set("workspace", tmpDir)
v.Set("apibaseurl", "http://api.example.com")

cfg := config.Config{
Persister: config.InMemoryPersister{},
Expand Down Expand Up @@ -92,6 +93,7 @@ func TestSubmitExerciseWithoutMetadataFile(t *testing.T) {
v := viper.New()
v.Set("token", "abc123")
v.Set("workspace", tmpDir)
v.Set("apibaseurl", "http://api.example.com")

cfg := config.Config{
Persister: config.InMemoryPersister{},
Expand All @@ -113,6 +115,7 @@ func TestSubmitFilesAndDir(t *testing.T) {
v := viper.New()
v.Set("token", "abc123")
v.Set("workspace", tmpDir)
v.Set("apibaseurl", "http://api.example.com")

cfg := config.Config{
Persister: config.InMemoryPersister{},
Expand Down Expand Up @@ -426,6 +429,7 @@ func TestSubmitOnlyEmptyFile(t *testing.T) {
v := viper.New()
v.Set("token", "abc123")
v.Set("workspace", tmpDir)
v.Set("apibaseurl", "http://api.example.com")

cfg := config.Config{
Persister: config.InMemoryPersister{},
Expand Down Expand Up @@ -465,6 +469,7 @@ func TestSubmitFilesFromDifferentSolutions(t *testing.T) {
v := viper.New()
v.Set("token", "abc123")
v.Set("workspace", tmpDir)
v.Set("apibaseurl", "http://api.example.com")

cfg := config.Config{
Persister: config.InMemoryPersister{},
Expand Down

0 comments on commit 33cd3c0

Please sign in to comment.