Permalink
Browse files

Fix some wrong test conditions

  • Loading branch information...
1 parent fee2a20 commit 25555b308ac2500fba69d871b23a851239e24248 @priteau priteau committed Mar 25, 2013
Showing with 9 additions and 7 deletions.
  1. +9 −7 epu/dtrs/test/test_store.py
@@ -34,6 +34,8 @@ def test_store_dts(self):
self.store.describe_dt('mr_pink', dt_id_1)
except NotFoundError:
pass
+ else:
+ self.fail("expected NotFoundError")
# now make two changes, one from the original and one from what we read
dt2 = dt1.copy()
@@ -56,6 +58,7 @@ def test_store_dts(self):
def test_store_sites(self):
site_id_1 = new_id()
+ site_id_2 = new_id()
site1 = {
"name": "ec2.us-east-1",
"description": "Amazon EC2, US East (Virginia)",
@@ -76,11 +79,9 @@ def test_store_sites(self):
self.assertEqual(site1["description"], site1_read["description"])
self.assertEqual(site1["driver_class"], site1_read["driver_class"])
- # Get with a different user should throw an exception
- try:
- self.store.describe_site(site_id_1)
- except NotFoundError:
- pass
+ # Get with an unknown ID should return None
+ dt = self.store.describe_site(site_id_2)
+ self.assertEqual(None, dt)
# now make two changes, one from the original and one from what we read
site2 = site1.copy()
@@ -89,8 +90,7 @@ def test_store_sites(self):
site2_read = self.store.describe_site(site_id_1)
self.assertEqual("Nimbus", site2_read["description"])
- # Store another site for the same user
- site_id_2 = new_id()
+ # Store another site
site2 = {
"name": "futuregrid.hotel",
"description": "Nimbus cloud on the Hotel FutureGrid site",
@@ -150,6 +150,8 @@ def test_store_credentials(self):
site_id_1)
except NotFoundError:
pass
+ else:
+ self.fail("expected NotFoundError")
# Listing credentials should return both
credentials = self.store.list_credentials('mr_white')

0 comments on commit 25555b3

Please sign in to comment.