Example #1
0
    def test_mkdir(self):
        drive = Drive()

        info = drive.mkdir("drive://gsync_unittest/test_mkdir/a/b/c/d/e/f/g")
        self.assertIsNotNone(info)
        self.assertEqual(info.title, "g")

        drive.delete("drive://gsync_unittest/test_mkdir", skip_trash=True)
Example #2
0
    def test_mkdir(self):
        drive = Drive()

        info = drive.mkdir("drive://gsync_unittest/test_mkdir/a/b/c/d/e/f/g")
        self.assertIsNotNone(info)
        self.assertEqual(info.title, "g")

        drive.delete("drive://gsync_unittest/test_mkdir", skip_trash=True)
Example #3
0
def setup_drive_data(testcase):
    # Ironic, using Gsync to setup the tests, but if it fails the tests
    # will fail anyway, so we will be okay.
    assert os.path.exists("tests/data")

    drive = Drive()
    drive.delete("drive://gsync_unittest/", skip_trash=True)
    drive.mkdir("drive://gsync_unittest/")
    drive.create("drive://gsync_unittest/open_for_read.txt", {})
    drive.update("drive://gsync_unittest/open_for_read.txt", {},
                 media_body=MediaFileUpload("tests/data/open_for_read.txt",
                                            mimetype=MimeTypes.BINARY_FILE,
                                            resumable=True))
Example #4
0
def setup_drive_data(testcase):
    # Ironic, using Gsync to setup the tests, but if it fails the tests
    # will fail anyway, so we will be okay.
    assert os.path.exists("tests/data")

    drive = Drive()
    drive.delete("drive://gsync_unittest/", skip_trash=True)
    drive.mkdir("drive://gsync_unittest/")
    drive.create("drive://gsync_unittest/open_for_read.txt", {})
    drive.update("drive://gsync_unittest/open_for_read.txt", {},
        media_body=MediaFileUpload("tests/data/open_for_read.txt",
            mimetype=MimeTypes.BINARY_FILE, resumable=True
        )
    )