Bladeren bron

A few more test fixes from the merge.

Stefano Cossu 7 jaren geleden
bovenliggende
commit
ff47f8e71b
3 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 1 1
      lakesuperior/endpoints/ldp.py
  2. 1 0
      lakesuperior/model/ldpr.py
  3. 1 1
      tests/endpoints/test_ldp.py

+ 1 - 1
lakesuperior/endpoints/ldp.py

@@ -303,12 +303,12 @@ def put_resource(uid):
 
     try:
         ret = rsrc.put()
+        rsp_headers.update(rsrc.head())
     except (InvalidResourceError, ResourceExistsError) as e:
         return str(e), 409
     except TombstoneError as e:
         return _tombstone_response(e, uid)
 
-    rsp_headers.update(rsrc.head())
     if ret == Ldpr.RES_CREATED:
         rsp_code = 201
         rsp_headers['Location'] = rsp_body = rsrc.uri

+ 1 - 0
lakesuperior/model/ldpr.py

@@ -50,6 +50,7 @@ def atomic(fn):
             #if hasattr(self.rdfly.store, '_edits'):
             #    # @FIXME ugly.
             #    self.rdfly._conn.optimize_edits()
+            self.rdfly.store.commit()
             for ev in request.changelog:
                 #self._logger.info('Message: {}'.format(pformat(ev)))
                 self._send_event_msg(*ev)

+ 1 - 1
tests/endpoints/test_ldp.py

@@ -345,7 +345,7 @@ class TestLdp:
         '''
         Test delete response codes.
         '''
-        #create_resp = self.client.put('/ldp/test_delete01')
+        self.client.put('/ldp/test_delete01')
         delete_resp = self.client.delete('/ldp/test_delete01')
         assert delete_resp.status_code == 204