Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
a0c15382
Commit
a0c15382
authored
Jun 25, 2014
by
Jack Pearkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant-cloud: tests for configuration
parent
f3848068
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
post-processor/vagrant-cloud/post-processor_test.go
post-processor/vagrant-cloud/post-processor_test.go
+23
-5
No files found.
post-processor/vagrant-cloud/post-processor_test.go
View file @
a0c15382
...
...
@@ -6,17 +6,35 @@ import (
"testing"
)
func
testConfig
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{}
func
testGoodConfig
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
"access_token"
:
"foo"
,
"version_description"
:
"bar"
,
"box_tag"
:
"hashicorp/precise64"
,
"version"
:
"0.5"
,
}
}
func
testBadConfig
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
"access_token"
:
"foo"
,
"box_tag"
:
"baz"
,
"version_description"
:
"bar"
,
}
}
func
testPP
(
t
*
testing
.
T
)
*
PostProcessor
{
func
TestPostProcessor_Configure_Good
(
t
*
testing
.
T
)
{
var
p
PostProcessor
if
err
:=
p
.
Configure
(
testConfig
());
err
!=
nil
{
if
err
:=
p
.
Configure
(
test
Good
Config
());
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
}
return
&
p
func
TestPostProcessor_Configure_Bad
(
t
*
testing
.
T
)
{
var
p
PostProcessor
if
err
:=
p
.
Configure
(
testBadConfig
());
err
==
nil
{
t
.
Fatalf
(
"should have err"
)
}
}
func
testUi
()
*
packer
.
BasicUi
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment