# Path: sevenbridges/transfer/utils.py
# class Part:
#     def __init__(self, start=None, size=None):
#         self._start = start
#         self._size = size
# 
#     @property
#     def start(self):
#         return self._start
# 
#     @property
#     def size(self):
#         return self._size
# 
# class Progress:
#     def __init__(self, num_of_parts, parts_done, bytes_done,
#                  file_size, duration):
#         self._num_of_parts = num_of_parts
#         self._parts_done = parts_done
#         self._bytes_done = bytes_done
#         self._file_size = file_size
#         self._duration = duration
# 
#     @property
#     def num_of_parts(self):
#         return self._num_of_parts
# 
#     @property
#     def parts_done(self):
#         return self._parts_done
# 
#     @property
#     def bytes_done(self):
#         return self._bytes_done
# 
#     @property
#     def file_size(self):
#         return self._file_size
# 
#     @property
#     def duration(self):
#         return self._duration
# 
#     @property
#     def progress(self):
#         progress = (self._bytes_done / float(self._file_size)) * 100
#         progress = progress if progress <= 100 else 100
#         return progress
# 
#     @property
#     def bandwidth(self):
#         return (self._bytes_done / 1000000) / self.duration


from sevenbridges.transfer.utils import Part, Progress


def test_transfer_utils():
    start = 10
    size = 20
    part = Part(start=start, size=size)
    assert part.start == start and part.size == size

    num_of_parts = 10
    parts_done = 2
    bytes_done = 2000000
    file_size = 10
    duration = 2
    p = Progress(num_of_parts, parts_done, bytes_done, file_size, duration)

    assert p.num_of_parts == num_of_parts

# Path: sevenbridges/transfer/utils.py
# class Part:
#     def __init__(self, start=None, size=None):
#         self._start = start
#         self._size = size
# 
#     @property
#     def start(self):
#         return self._start
# 
#     @property
#     def size(self):
#         return self._size
# 
# class Progress:
#     def __init__(self, num_of_parts, parts_done, bytes_done,
#                  file_size, duration):
#         self._num_of_parts = num_of_parts
#         self._parts_done = parts_done
#         self._bytes_done = bytes_done
#         self._file_size = file_size
#         self._duration = duration
# 
#     @property
#     def num_of_parts(self):
#         return self._num_of_parts
# 
#     @property
#     def parts_done(self):
#         return self._parts_done
# 
#     @property
#     def bytes_done(self):
#         return self._bytes_done
# 
#     @property
#     def file_size(self):
#         return self._file_size
# 
#     @property
#     def duration(self):
#         return self._duration
# 
#     @property
#     def progress(self):
#         progress = (self._bytes_done / float(self._file_size)) * 100
#         progress = progress if progress <= 100 else 100
#         return progress
# 
#     @property
#     def bandwidth(self):
#         return (self._bytes_done / 1000000) / self.duration


# Path: tests/test_utils.py
from sevenbridges.transfer.utils import Part, Progress



def test_transfer_utils():
    start = 10
    size = 20
    part = Part(start=start, size=size)
    assert part.start == start and part.size == size

    num_of_parts = 10
    parts_done = 2
    bytes_done = 2000000
    file_size = 10
    duration = 2
    p = Progress(num_of_parts, parts_done, bytes_done, file_size, duration)

    assert p.num_of_parts == num_of_parts

    assert p.file_size == file_size