예제 #1
0
    def assert_rename(self,
                      fileset,
                      new_dir,
                      client=None,
                      mrepo=None,
                      ctx=None):
        """
        Change the path entry for the files contained
        in the orig_dir and then verify that they will
        only be listed as belonging to the new_dir. The
        files on disk ARE NOT MOVED.
        """
        if client is None:
            client = self.client
        if mrepo is None:
            mrepo = self.mrepo

        orig_dir = fileset.templatePrefix.val

        # Before the move the new location should be empty
        assert 3 == len(list(contents(mrepo, orig_dir, ctx)))
        assert 0 == len(list(contents(mrepo, new_dir, ctx)))

        rv = rename_fileset(client, mrepo, fileset, new_dir, ctx=ctx)

        # After the move, the old location should be empty
        assert 0 == len(list(contents(mrepo, orig_dir, ctx)))
        assert 3 == len(list(contents(mrepo, new_dir, ctx)))

        return rv
예제 #2
0
    def assert_rename(self, fileset, new_dir, client=None, mrepo=None, ctx=None):
        """
        Change the path entry for the files contained
        in the orig_dir and then verify that they will
        only be listed as belonging to the new_dir. The
        files on disk ARE NOT MOVED.
        """
        if client is None:
            client = self.client
        if mrepo is None:
            mrepo = self.mrepo

        orig_dir = fileset.templatePrefix.val

        # Before the move the new location should be empty
        assert 3 == len(list(contents(mrepo, orig_dir, ctx)))
        assert 0 == len(list(contents(mrepo, new_dir, ctx)))

        rv = rename_fileset(client, mrepo, fileset, new_dir, ctx=ctx)

        # After the move, the old location should be empty
        assert 0 == len(list(contents(mrepo, orig_dir, ctx)))
        assert 3 == len(list(contents(mrepo, new_dir, ctx)))

        return rv
예제 #3
0
 def test_prep_and_delete(self):
     mrepo = self.client.getManagedRepository()
     new_dir = prep_directory(self.client, mrepo)
     tree = list(contents(mrepo, new_dir))
     assert 0 == len(tree)
예제 #4
0
 def test_prep_and_delete(self):
     mrepo = self.client.getManagedRepository()
     new_dir = prep_directory(self.client, mrepo)
     tree = list(contents(mrepo, new_dir))
     assert 0 == len(tree)