def test_init(self):
        """Test File.__init__()."""

        kwargs = dict(bucket='bucket_id',
                      hash='hash',
                      mimetype='mimetype',
                      filename='filename',
                      frame='frame_id')

        f = File(**kwargs)

        assert f.bucket == Bucket(id=kwargs['bucket'])
        assert f.hash == kwargs['hash']
        assert f.mimetype == kwargs['mimetype']
        assert f.filename == kwargs['filename']
        assert f.frame == Frame(id=kwargs['frame'])
        assert f.shard_manager is None
    def test_init(self):
        """Test Token.__init__()."""

        kwargs = dict(
            token=None,
            bucket='bucket_id',
            operation='operation',
            expires='2016-10-13T04:23:48.183Z',
            encryptionKey='key_id',
        )

        token = Token(**kwargs)

        assert token.id == kwargs['token']
        assert token.bucket == Bucket(id=kwargs['bucket'])
        assert token.operation == kwargs['operation']
        assert token.expires == datetime.fromtimestamp(
            strict_rfc3339.rfc3339_to_timestamp(kwargs['expires']))
        assert token.encryptionKey == kwargs['encryptionKey']
    def test_init(self):
        """Test Bucket.__init__()."""
        kwargs = dict(created='2016-10-13T04:23:48.183Z',
                      id='510b23e9f63a77d939a72a77',
                      name='integration-20161013_042347',
                      pubkeys=[],
                      status='Active',
                      storage=0,
                      transfer=0,
                      user='******')

        bucket = Bucket(**kwargs)

        assert bucket.created == datetime.fromtimestamp(
            strict_rfc3339.rfc3339_to_timestamp('2016-10-13T04:23:48.183Z'))
        assert bucket.id == '510b23e9f63a77d939a72a77'
        assert bucket.name == 'integration-20161013_042347'
        assert bucket.pubkeys == []
        assert bucket.status == 'Active'
        assert bucket.storage == 0
        assert bucket.transfer == 0
        assert bucket.user == '*****@*****.**'