test-lfs: drop trailing ', ' item separators from debug JSON output
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 14 Mar 2018 23:34:08 -0400
changeset 37146 c37c47e47a95
parent 37145 56c7cd067477
child 37147 a2566597acb5
test-lfs: drop trailing ', ' item separators from debug JSON output The trailing space looks weird when conditionalizing the line. The commas shouldn't be necessary because of the indenting. The `lfs-test-server` isn't sending all of the same items (notably, the "transfer" attribute is missing), so having the commas means more lines need to be conditionalized.
hgext/lfs/blobstore.py
tests/test-lfs-test-server.t
--- a/hgext/lfs/blobstore.py	Thu Feb 22 23:33:52 2018 -0500
+++ b/hgext/lfs/blobstore.py	Wed Mar 14 23:34:08 2018 -0400
@@ -249,7 +249,8 @@
                 response['objects'] = sorted(response['objects'],
                                              key=lambda p: p['oid'])
             self.ui.debug('%s\n'
-                          % json.dumps(response, indent=2, sort_keys=True))
+                          % json.dumps(response, indent=2,
+                                       separators=('', ': '), sort_keys=True))
 
         return response
 
--- a/tests/test-lfs-test-server.t	Thu Feb 22 23:33:52 2018 -0500
+++ b/tests/test-lfs-test-server.t	Wed Mar 14 23:34:08 2018 -0400
@@ -63,14 +63,14 @@
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
       }
     ]
@@ -133,14 +133,14 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
       }
     ]
@@ -184,40 +184,40 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
-      }, 
+      }
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
           }
-        }, 
-        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19", 
+        }
+        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
         "size": 20
-      }, 
+      }
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -289,27 +289,27 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
           }
-        }, 
-        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19", 
+        }
+        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
         "size": 20
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -362,14 +362,14 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -416,14 +416,14 @@
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0"
           }
-        }, 
-        "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0", 
+        }
+        "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0"
         "size": 17
       }
     ]
@@ -447,40 +447,40 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
           }
-        }, 
-        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19", 
+        }
+        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
         "size": 20
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -533,27 +533,27 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -600,40 +600,40 @@
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
           }
-        }, 
-        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b", 
+        }
+        "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
         "size": 12
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
           }
-        }, 
-        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19", 
+        }
+        "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
         "size": 20
-      }, 
+      }
       {
         "actions": {
           "download": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
           }
-        }, 
-        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998", 
+        }
+        "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
         "size": 19
       }
     ]
@@ -687,14 +687,14 @@
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13"
           }
-        }, 
-        "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13", 
+        }
+        "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13"
         "size": 6
       }
     ]
@@ -754,14 +754,14 @@
       {
         "actions": {
           "upload": {
-            "expires_at": "$ISO_8601_DATE_TIME$", 
+            "expires_at": "$ISO_8601_DATE_TIME$"
             "header": {
               "Accept": "application/vnd.git-lfs"
-            }, 
+            }
             "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a"
           }
-        }, 
-        "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a", 
+        }
+        "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a"
         "size": 6
       }
     ]