Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

bug: fix up AWS conditional binding and assoc. conditions #532

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Conversation

jrconlin
Copy link
Member

AWS throws an exception if conditional args are not defined, this
impacted tests by failing, but throwing an exception and causing fun
havoc. register_user now fails if all conditionals are not met
(preserving previous behaviors). Added tests for older records that may
be incomplete.

Some formatting fixes included as well

@bbangert r?

@codecov-io
Copy link

codecov-io commented Jul 19, 2016

Current coverage is 100%

Merging #532 into master will increase coverage by 0.04%

@@             master   #532   diff @@
======================================
  Files            40     40          
  Lines          8352   8365    +13   
  Methods           0      0          
  Messages          0      0          
  Branches          0      0          
======================================
+ Hits           8348   8365    +17   
+ Misses            4      0     -4   
  Partials          0      0          

Powered by Codecov. Last updated by a79f3a6...6b73a7f

@@ -582,6 +582,9 @@ def register_user(self, data):
conn = self.table.connection
db_key = self.encode({"uaid": hasher(data["uaid"])})
del data["uaid"]
if "router_type" not in data or "connected_at" not in data:
# Not specifying these values will generate an exception in AWS.
return (False, {}, data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to accidentally mask a call that thinks the condition is failing vs. being called with incorrect data?

try:
router.register_user(dict(uaid=uaid))
except:
pass
self.assertRaises(ItemNotFound, router.get_uaid, uaid)
self.assertRaises(ItemNotFound, router.table.get_item,
consistent=True, uaid=uaid)
assert(router.drop_user.called)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok_

@bbangert
Copy link
Member

r+ with 2 minor nits

AWS throws an exception if conditional args are not defined, this
impacted tests by failing, but throwing an exception and causing fun
havoc. register_user now fails if all conditionals are not met
(preserving previous behaviors). Added tests for older records that may
be incomplete.

Some formatting fixes included as well
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants