Example #1
0
    def test_sww_header(self):
        """Test that constant sww information can be written correctly
        (non smooth)
        """
        self.domain.set_name('datatest' + str(id(self)))
        self.domain.format = 'sww' #Remove??
        self.domain.smooth = False

        sww = SWW_file(self.domain)
        sww.store_connectivity()

        # Check contents
        # Get NetCDF
        fid = NetCDFFile(sww.filename, netcdf_mode_r)  # Open existing file for append

        # Get the variables
        sww_revision = fid.revision_number
        try:
            revision_number = get_revision_number()
        except:
            revision_number = None
            
        assert str(revision_number) == sww_revision
        fid.close()

        #print "sww.filename", sww.filename
        os.remove(sww.filename)
Example #2
0
if __name__ == '__main__':
    check_anuga_import()

    if len(sys.argv) > 1 and sys.argv[1][0].upper() == 'V':
        test_verbose = True
        saveout = sys.stdout
        filename = ".temp"
        fid = open(filename, 'w')
        sys.stdout = fid
    else:
        test_verbose = False
    suite = regressionTest(test_verbose)
    runner = unittest.TextTestRunner(verbosity=1)
    runner.run(suite)

    # timestamp at the end
    timestamp = time.asctime()
    version = aust.get_revision_number()
    print
    print 'Finished at %s, version %s' % (timestamp, version)

    # Cleaning up
    if len(sys.argv) > 1 and sys.argv[1][0].upper() == 'V':
        sys.stdout = saveout
        #fid.close() # This was causing an error in windows
        #os.remove(filename)

    if sys.platform == 'win32':
        raw_input('Press the RETURN key')
    if options.quiet:
        saveout = sys.stdout
        filename = CaptureFilename
        fid = open(filename, 'w')
        sys.stdout = fid

    # run the tests
    suite = regressionTest(options.quiet)
    runner = unittest.TextTestRunner(verbosity=options.verbosity)
    runner.run(suite)

    # timestamp at the end
    timestamp = time.asctime()
    major_revision = __version__
    minor_revision = aust.get_revision_number()
    print('\nFinished at %s, version %s %s' %
          (timestamp, major_revision, minor_revision))

    # Cleaning up
    if options.verbosity < 1:
        sys.stdout = saveout
        #fid.close() # This was causing an error in windows
        #os.remove(filename)

    import os
    for file in os.listdir('.'):
        if file.endswith('.sww') or\
                file.endswith('.msh') or\
                file.endswith('.csv') or\
                file.endswith('.asc') or\
Example #4
0
    if options.quiet:
        saveout = sys.stdout
        filename = CaptureFilename
        fid = open(filename, 'w')
        sys.stdout = fid

    # run the tests
    suite = regressionTest(options.quiet)
    runner = unittest.TextTestRunner(verbosity=options.verbosity)
    runner.run(suite)

    # timestamp at the end
    timestamp = time.asctime()
    major_revision = __version__
    minor_revision = aust.get_revision_number()
    print '\nFinished at %s, version %s %s' % (timestamp, major_revision, minor_revision)

    # Cleaning up
    if options.verbosity < 1:
        sys.stdout = saveout
        #fid.close() # This was causing an error in windows
        #os.remove(filename)
    


    import os
    for file in os.listdir('.'):
        if file.endswith('.sww') or\
                file.endswith('.msh') or\
                file.endswith('.csv') or\
Example #5
0
if __name__ == '__main__':
    check_anuga_import()

    if len(sys.argv) > 1 and sys.argv[1][0].upper() == 'V':
        test_verbose = True
        saveout = sys.stdout
        filename = ".temp"
        fid = open(filename, 'w')
        sys.stdout = fid
    else:
        test_verbose = False
    suite = regressionTest(test_verbose)
    runner = unittest.TextTestRunner(verbosity=1)
    runner.run(suite)

    # timestamp at the end
    timestamp = time.asctime()
    version = aust.get_revision_number()
    print
    print 'Finished at %s, version %s' % (timestamp, version)

    # Cleaning up
    if len(sys.argv) > 1 and sys.argv[1][0].upper() == 'V':
        sys.stdout = saveout
        #fid.close() # This was causing an error in windows
        #os.remove(filename)

    
    if sys.platform == 'win32':
        raw_input('Press the RETURN key')