Changeset 5041


Ignore:
Timestamp:
Feb 18, 2008, 5:52:52 PM (16 years ago)
Author:
ole
Message:

Added new test for checksum's based on a real, persistent files. Previous tests were based on generated files.

Location:
anuga_core/source/anuga/utilities
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/test_system_tools.py

    r5008 r5041  
    55from Numeric import zeros, array, allclose, Float
    66from Scientific.IO.NetCDF import NetCDFFile
     7import zlib
    78
    89from system_tools import *
     
    3334        """
    3435
    35         import zlib
    3636        from tempfile import mkstemp, mktemp
    3737
     
    9898        os.remove(filename2)
    9999
     100
     101    def test_compute_checksum_real(self):
     102        """test_compute_checksum(self):
     103
     104        Check that checksums on a png file is OK
     105        """
     106
     107        filename = 'crc_test_file.png'
     108
     109        ref_crc = -1808745910  # Computed on Windows box
     110        checksum = compute_checksum(filename)
     111
     112        msg = 'Computed checksum = %s, should have been %s' %(checksum, ref_crc)
     113        assert checksum == ref_crc, msg
     114        #print checksum
     115       
    100116       
    101117#-------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.