# Path: pypif/obj/common/file_reference.py
# class FileReference(Pio):
#     """
#     Information about a file.
#     """
# 
#     def __init__(self, relative_path=None, url=None, mime_type=None, sha256=None, md5=None, tags=None, **kwargs):
#         """
#         Constructor.
# 
#         :param relative_path: String with the relative path (from the location of this file) of the file.
#         :param mime_type: String with the mime type of the file.
#         :param sha256: String with the SHA-256 hash of the file.
#         :param md5: String with the MD5 hash of the file.
#         :param tags: List of strings or numbers that are tags for this object.
#         :param kwargs: Dictionary of fields that are not supported.
#         """
#         super(FileReference, self).__init__(tags=tags, **kwargs)
#         self._relative_path = None
#         self.relative_path = relative_path
#         self._url = None
#         self.url = url
#         self._mime_type = None
#         self.mime_type = mime_type
#         self._sha256 = None
#         self.sha256 = None
#         self._md5 = None
#         self.md5 = None
# 
#     @property
#     def relative_path(self):
#         return self._relative_path
# 
#     @relative_path.setter
#     def relative_path(self, relative_path):
#         self._validate_type('relative_path', relative_path, string_types)
#         self._relative_path = relative_path
# 
#     @relative_path.deleter
#     def relative_path(self):
#         self._relative_path = None
# 
#     @property
#     def url(self):
#         return self._url
# 
#     @url.setter
#     def url(self, url):
#         self._validate_type('url', url, string_types)
#         self._url = url
# 
#     @url.deleter
#     def url(self):
#         self._url = None
# 
#     @property
#     def mime_type(self):
#         return self._mime_type
# 
#     @mime_type.setter
#     def mime_type(self, mime_type):
#         self._validate_type('mime_type', mime_type, string_types)
#         self._mime_type = mime_type
# 
#     @mime_type.deleter
#     def mime_type(self):
#         self._mime_type = None
# 
#     @property
#     def sha256(self):
#         return self._sha256
# 
#     @sha256.setter
#     def sha256(self, sha256):
#         self._validate_type('sha256', sha256, string_types)
#         self._sha256 = sha256
# 
#     @sha256.deleter
#     def sha256(self):
#         self._sha256 = None
# 
#     @property
#     def md5(self):
#         return self._md5
# 
#     @md5.setter
#     def md5(self, md5):
#         self._validate_type('md5', md5, string_types)
#         self._md5 = md5
# 
#     @md5.deleter
#     def md5(self):
#         self._md5 = None
# 
# Path: pypif/pif.py
# def dump(pif, fp, **kwargs):
# def dumps(pif, **kwargs):
# def load(fp, class_=None, **kwargs):
# def loads(s, class_=None, **kwargs):
# def loado(obj, class_=None):
# def _dict_to_pio(d, class_=None):


from pypif.obj.common.file_reference import FileReference
from pypif import pif

def test_round_robin():
    url = "https://citrination.com/datasets/1160/version/3/file/308882"
    path = "/tmp/foo.bar"
    fr = FileReference(url=url, relative_path=path)
    assert fr.relative_path == path, "Python object couldn't store relative path"
    assert fr.url == url, "Python object couldn't store URL"

# Path: pypif/obj/common/file_reference.py
# class FileReference(Pio):
#     """
#     Information about a file.
#     """
# 
#     def __init__(self, relative_path=None, url=None, mime_type=None, sha256=None, md5=None, tags=None, **kwargs):
#         """
#         Constructor.
# 
#         :param relative_path: String with the relative path (from the location of this file) of the file.
#         :param mime_type: String with the mime type of the file.
#         :param sha256: String with the SHA-256 hash of the file.
#         :param md5: String with the MD5 hash of the file.
#         :param tags: List of strings or numbers that are tags for this object.
#         :param kwargs: Dictionary of fields that are not supported.
#         """
#         super(FileReference, self).__init__(tags=tags, **kwargs)
#         self._relative_path = None
#         self.relative_path = relative_path
#         self._url = None
#         self.url = url
#         self._mime_type = None
#         self.mime_type = mime_type
#         self._sha256 = None
#         self.sha256 = None
#         self._md5 = None
#         self.md5 = None
# 
#     @property
#     def relative_path(self):
#         return self._relative_path
# 
#     @relative_path.setter
#     def relative_path(self, relative_path):
#         self._validate_type('relative_path', relative_path, string_types)
#         self._relative_path = relative_path
# 
#     @relative_path.deleter
#     def relative_path(self):
#         self._relative_path = None
# 
#     @property
#     def url(self):
#         return self._url
# 
#     @url.setter
#     def url(self, url):
#         self._validate_type('url', url, string_types)
#         self._url = url
# 
#     @url.deleter
#     def url(self):
#         self._url = None
# 
#     @property
#     def mime_type(self):
#         return self._mime_type
# 
#     @mime_type.setter
#     def mime_type(self, mime_type):
#         self._validate_type('mime_type', mime_type, string_types)
#         self._mime_type = mime_type
# 
#     @mime_type.deleter
#     def mime_type(self):
#         self._mime_type = None
# 
#     @property
#     def sha256(self):
#         return self._sha256
# 
#     @sha256.setter
#     def sha256(self, sha256):
#         self._validate_type('sha256', sha256, string_types)
#         self._sha256 = sha256
# 
#     @sha256.deleter
#     def sha256(self):
#         self._sha256 = None
# 
#     @property
#     def md5(self):
#         return self._md5
# 
#     @md5.setter
#     def md5(self, md5):
#         self._validate_type('md5', md5, string_types)
#         self._md5 = md5
# 
#     @md5.deleter
#     def md5(self):
#         self._md5 = None
# 
# Path: pypif/pif.py
# def dump(pif, fp, **kwargs):
# def dumps(pif, **kwargs):
# def load(fp, class_=None, **kwargs):
# def loads(s, class_=None, **kwargs):
# def loado(obj, class_=None):
# def _dict_to_pio(d, class_=None):


# Path: pypif/obj/common/tests/test_file_reference.py
from pypif.obj.common.file_reference import FileReference
from pypif import pif


def test_round_robin():
    url = "https://citrination.com/datasets/1160/version/3/file/308882"
    path = "/tmp/foo.bar"
    fr = FileReference(url=url, relative_path=path)
    assert fr.relative_path == path, "Python object couldn't store relative path"
    assert fr.url == url, "Python object couldn't store URL"

    round_robin = pif.loads(pif.dumps(fr), class_=FileReference)