Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2496

Fix test_blob_with_non_standard_digest_and_standard_algo()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Tests

      Description

      The test is failing every time:

      $ python -m pytest -n0 tests/old_functional/test_direct_edit.py::TestDirectEdit::test_blob_with_non_standard_digest_and_standard_algo
      $ python -m pytest -n0 tests/old_functional/test_direct_edit.py::TestDirectEditNoSync::test_blob_with_non_standard_digest_and_standard_algo
      
          def test_blob_with_non_standard_digest_and_standard_algo(self):
              """It should be possible to edit a document having a blob with a non-standard digest
              but with a standard algorithm.
              """
          
              from_dict_orig = Blob.from_dict
          
              def from_dict(blob: Dict[str, Any]) -> Blob:
                  # Alter digest stuff
                  blob["digest"] += "-2"
                  return from_dict_orig(blob)
          
              filename = "picture-with-non-standard-digest.png"
              content = random_png(size=42)
              # make_file() will make use of the FileManager and thus creating a Picture document
              doc_id = self.remote.make_file("/", filename, content=content)
          
              scheme, host = self.nuxeo_url.split("://")
              url = (
                  f"nxdrive://edit/{scheme}/{host}"
                  f"/user/{self.user_1}"
                  "/repo/default"
                  f"/nxdocid/{doc_id}"
                  f"/filename/{filename}"
                  f"/downloadUrl/nxfile/default/{doc_id}"
                  f"/file:content/{filename}"
              )
          
              content_updated = random_png(size=24)
              with patch.object(Blob, "from_dict", new=from_dict), ensure_no_exception():
      >           self._direct_edit_update(doc_id, filename, content_updated, url=url)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m