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

Fix test test_get_metadata_infos()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.4.4
    • Fix Version/s: 4.5.0
    • Component/s: Tests

      Description

      Since the move to Web-UI by default (NXDRIVE-2223), that test no more passes:

      self = <tests.old_functional.test_context_menu.TestContextMenu testMethod=test_get_metadata_infos>
      
          def test_get_metadata_infos(self):
              """This will test "Access online" and "Edit metadata" entries."""
              manager = self.manager_1
              local = self.local_1
          
              # Document does not inexist
              with pytest.raises(ValueError):
                  manager.get_metadata_infos("/a folder/a file.bin")
          
              # Document exists
              local.make_folder("/", "a folder")
              file = local.make_file("/a folder", "a file.bin", content=b"something")
              self.wait_sync()
              path = local.abspath(file)
              assert isfile(path)
          
              # "Access online" entry
              url = manager.get_metadata_infos(path)
              assert url.startswith("http")
              assert "token" not in url
          
              # "Edit metadata" entry
              url_edit = manager.get_metadata_infos(path, edit=True)
              assert url.startswith("http")
      >       assert url_edit != url
      E       AssertionError: assert 'http://localhost:8080/nuxeo/ui#!/doc/2fc4da32-e358-42a5-8de9-994d56f906af' != 'http://localhost:8080/nuxeo/ui#!/doc/2fc4da32-e358-42a5-8de9-994d56f906af'
      
      file       = PosixPath('a folder/a file.bin')
      local      = <LocalTest base_folder=PosixPath('/tmp/635e8fc8/1/drive/test_get_metadata_infos-linux-26429'), is_case_sensitive=None>
      manager    = <Manager home=PosixPath('/tmp/635e8fc8/1/conf')>
      path       = PosixPath('/tmp/635e8fc8/1/drive/test_get_metadata_infos-linux-26429/a folder/a file.bin')
      self       = <tests.old_functional.test_context_menu.TestContextMenu testMethod=test_get_metadata_infos>
      url        = 'http://localhost:8080/nuxeo/ui#!/doc/2fc4da32-e358-42a5-8de9-994d56f906af'
      url_edit   = 'http://localhost:8080/nuxeo/ui#!/doc/2fc4da32-e358-42a5-8de9-994d56f906af'
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

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