Dorothydu's picture
Upload 50 random repository samples
9d3c8f5 verified
# -*- coding: utf-8 -*-
import unittest
from main import S3Path # Update this import statement to point to the S3Path in main.py
class TestS3Path(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.bucket = S3Path("bucket")
cls.directory = S3Path("bucket", "folder/")
cls.file = S3Path("bucket", "folder", "file.txt")
cls.relpath = cls.file.relative_to(cls.bucket)
cls.void = S3Path()
def test_bucket(self):
self.assertEqual(str(self.bucket), "bucket")
def test_directory(self):
self.assertEqual(str(self.directory), "bucket/folder/")
def test_file(self):
self.assertEqual(str(self.file), "bucket/folder/file.txt")
def test_relpath(self):
self.assertEqual(str(self.relpath), "folder/file.txt")
def test_void(self):
self.assertEqual(str(self.void), "")
if __name__ == "__main__":
unittest.main()