Skip to content

Commit

Permalink
Merge pull request #179 from caseyhen/master
Browse files Browse the repository at this point in the history
Fix for #178
  • Loading branch information
koalalorenzo committed Feb 11, 2017
2 parents 11bdef7 + e845a99 commit ecf2c1b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions digitalocean/Droplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def create_multiple(*args, **kwargs):
"backups": bool(kwargs.get("backups")),
"ipv6": bool(kwargs.get("ipv6")),
"private_networking": bool(kwargs.get("private_networking")),
"tags": kwargs.get("tags"),
"monitoring": bool(kwargs.get("monitoring")),
}

Expand Down Expand Up @@ -553,6 +554,7 @@ def create(self, *args, **kwargs):
"ipv6": bool(self.ipv6),
"private_networking": bool(self.private_networking),
"volumes": self.volumes,
"tags": self.tags,
"monitoring": bool(self.monitoring),
}

Expand Down
5 changes: 4 additions & 1 deletion digitalocean/tests/data/droplet_actions/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"networks": {
},
"region": {
}
},
"tags": [
"web"
]
},
"links": {
"actions": [
Expand Down
10 changes: 8 additions & 2 deletions digitalocean/tests/data/droplet_actions/create_multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"networks": {
},
"region": {
}
},
"tags": [
"web"
]
}, {
"id": 3164495,
"name": "example2.com",
Expand Down Expand Up @@ -62,7 +65,10 @@
"networks": {
},
"region": {
}
},
"tags": [
"web"
]
}],
"links": {
"actions": [
Expand Down
10 changes: 6 additions & 4 deletions digitalocean/tests/test_droplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ def test_create_no_keys(self):
private_networking=True,
monitoring=True,
user_data="Some user data.",
token=self.token)
token=self.token,
tags=["web"])
droplet.create()

self.assert_url_query_equal(responses.calls[0].request.url,
Expand All @@ -812,7 +813,7 @@ def test_create_no_keys(self):
u"private_networking": True, u"monitoring": True,
u"backups": True, u"image": u"ubuntu-14-04-x64",
u"size": u"512mb", u"ssh_keys": [],
u"volumes": []})
u"volumes": [], u"tags": ["web"]})
self.assertEqual(droplet.id, 3164494)
self.assertEqual(droplet.action_ids, [36805096])

Expand All @@ -836,7 +837,8 @@ def test_create_multiple_no_keys(self):
private_networking=True,
monitoring=True,
user_data="Some user data.",
token=self.token)
token=self.token,
tags=["web"])
self.assert_url_query_equal(responses.calls[0].request.url,
self.base_url + "droplets")
self.assertEqual(len(droplets), 2)
Expand All @@ -852,7 +854,7 @@ def test_create_multiple_no_keys(self):
u"user_data": u"Some user data.", u"ipv6": True,
u"private_networking": True, u"monitoring": True,
u"backups": True, u"image": u"ubuntu-14-04-x64",
u"size": u"512mb"})
u"size": u"512mb", u"tags": ["web"]})


@responses.activate
Expand Down

0 comments on commit ecf2c1b

Please sign in to comment.