Changeset 6615


Ignore:
Timestamp:
Mar 25, 2009, 2:55:35 PM (15 years ago)
Author:
rwilson
Message:

Changes to make test work from test_all.py.

File:
1 edited

Legend:

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

    r6614 r6615  
    44import unittest
    55import tempfile
     6import random
    67import Numeric as num
    78import zlib
     
    166167        '''Test that tarring & untarring files is OK.'''
    167168
     169        num_lines = 100
     170        line_size = 100
     171
    168172        # these test files must exist in the current directory
    169         files = ('test_system_tools.py', 'system_tools.py')
     173        # create them with random data
     174        files = ('alpha', 'beta', 'gamma')
     175        for file in files:
     176            fd = open(file, 'w')
     177            line = ''
     178            for i in range(num_lines):
     179                for j in range(line_size):
     180                    line += chr(random.randint(ord('A'), ord('Z')))
     181                line += '\n'
     182                fd.write(line)
     183            fd.close()
    170184
    171185        # name of tar file and test (temp) directory
     
    190204            self.failUnless(orig == copy, msg)
    191205
     206        # clean up
     207        for file in files:
     208            os.remove(file)
    192209        os.remove(tar_filename)
    193210
Note: See TracChangeset for help on using the changeset viewer.