Commits

Anonymous committed 314e6b9 Draft

add full test coverage of retro-compat for key calc feature

Comments (0)

Files changed (1)

dynamodb_mapper/tests/test_model.py

     def tearDown(self):
         ConnectionBorg()._connections.clear()
 
+    def test_compute_keys(self):
+        self.assertEquals((None, None), Patch.compute_keys())
+        self.assertEquals((42, None), Patch.compute_keys(42))
+        self.assertEquals((42, None), Patch.compute_keys(hash_key_value=42))
+        self.assertEquals((42, "map"), Patch.compute_keys(42, "map"))
+        self.assertEquals((42, "map"), Patch.compute_keys(42, range_key_value="map"))
+        self.assertEquals((42, "map"), Patch.compute_keys(hash_key_value=42, range_key_value="map"))
+
     def test_to_json_dict(self):
         testdate = datetime.datetime(2012, 5, 31, 12, 0, 0, tzinfo=utc_tz)
         testSet = set(["level 52","level 1"])