Skip to content

Commit

Permalink
Merge 42947c0 into 6705a3a
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredBroda committed Nov 30, 2017
2 parents 6705a3a + 42947c0 commit a47f200
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions mesosutils/taskinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,23 @@ func TestGetWeightReturnsWeightFromTagLabel(t *testing.T) {
require.Equal(t, 50, weight)
require.NoError(t, err)
}

func TestFindEnvValueReturnsCorrectValue(t *testing.T) {
expectedValue := "test env value"
key := "TEST_ENV_KEY"
vars := []mesos.Environment_Variable{
{Name: key, Value: expectedValue},
}
mesosTaskInfo := mesos.TaskInfo{
Command: &mesos.CommandInfo{
Environment: &mesos.Environment{Variables: vars},
},
}
taskInfo := TaskInfo{
TaskInfo: mesosTaskInfo,
}

returnedValue := taskInfo.FindEnvValue(key)

require.Equal(t, returnedValue, expectedValue)
}

0 comments on commit a47f200

Please sign in to comment.