• Kirill Smelkov's avatar
    BigFile: Basic tests · 9bf0d1e1
    Kirill Smelkov authored
    So far BigFile was not unit-tested and because of recent BigFile patches
    and fixes Romain suggested to write tests for it.
    
    We test:
    
        - working with BigFile via its public interface:
    
          * GET/PUT both in plain and with ranges variants,
          *.getData()/.getSize(), and
          * recently-introduced ._appendData()
    
        - that BigFile correctly handles situations where .data is either
          None or str or BTreeData and that migration automatically happens
          to BTreeData on append.
    
    ~~~~
    
    Unlike common case, BigFile more directly works on REQUEST and RESPONSE
    (instead of plain object publishing), so to test it we need not only call
    methods and compare return values but first prepare proper
    request/response, set them up and analyze response headers and content
    after method invocation happened.
    
    For preparing request/response Zope provides utility
    Testing.makerequest() and its 2 variations but for our case they all
    turned out to be not flexible enough - e.g. Testing.makerequest()...
    9bf0d1e1
version 3 Bytes