Ignore:
Timestamp:
Oct 18, 2007 11:36:17 AM (17 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8c050c1
Parents:
f98961f
Message:
  • Added method to add an object to the canvas instead of using the canvas object as a factory.
  • Completed unit tests and added stimuli to automated testing class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansrealspace/src/realspace/test/simulation_stimuli.py

    rba1d1e9 r3c75696  
    160160            except: 
    161161                report.log = "GetIq: bad value for Iq "+str(value) 
     162             
     163            report.trace = "I(q) = %g" % value 
     164            return canvas, report 
     165     
     166    class GetIq2DStimulus(Stimulus): 
     167        """Calculate I(q)""" 
     168 
     169        frequency = 1.0 
     170         
     171        def __call__(self, canvas): 
     172            report = generator.StimulusReport(tag=self.name) 
     173             
     174            # Check that a float is returned 
     175            # Validation testing will be done elsewhere 
     176            value = canvas.getIq2D(0.01,0.01) 
     177             
     178            # Check that it is in the list of objects 
     179            try: 
     180                float(value) 
     181                report.passed = 1 
     182            except: 
     183                report.log = "GetIq2D: bad value for Iq "+str(value) 
    162184             
    163185            report.trace = "I(q) = %g" % value 
Note: See TracChangeset for help on using the changeset viewer.