コード例 #1
0
class TestLamellar(unittest.TestCase):
    """ Unit tests for calculate_ER (Lamellarmodel)"""
    def setUp(self):
        from sas.models.LamellarModel import LamellarModel
        self.comp = LamellarModel()

    def test(self):
        """ Test 1D model for a Lamellar """
        #No finite number should return from Lamellar models.
        self.assertTrue(numpy.isfinite(self.comp.calculate_ER()))
コード例 #2
0
class TestLamellar(unittest.TestCase):
    """ Unit tests for calculate_ER (Lamellarmodel)"""
    
    def setUp(self):
        from sas.models.LamellarModel import LamellarModel
        self.comp = LamellarModel()
        
    def test(self):
        """ Test 1D model for a Lamellar """
        #No finite number should return from Lamellar models.
        self.assertTrue(numpy.isfinite(self.comp.calculate_ER())) 
コード例 #3
0
class TestLamellarHayterM(unittest.TestCase):
    """ 
        Unit tests for LamellarModel(Q) * HayterMSAStructure(Q)
    """
    def setUp(self):
        from sas.models.LamellarModel import LamellarModel
        from sas.models.HayterMSAStructure import HayterMSAStructure
        from sas.models.MultiplicationModel import MultiplicationModel

        self.model = LamellarModel()
        self.model2 = HayterMSAStructure()
        self.model3 = MultiplicationModel(self.model, self.model2)  

    #Radius of model1.calculate_ER should Not be finite.
    def test_multplication_radius(self):
        """
            test multiplication model (check the effective radius & the output
             of the multiplication)
        """
        #Check run       
        self.assertFalse(numpy.isfinite(self.model3.run(0.1)))
        #check effective radius . 
        self.assertTrue(numpy.isfinite(self.model.calculate_ER()))      
コード例 #4
0
class TestLamellarHayterM(unittest.TestCase):
    """ 
        Unit tests for LamellarModel(Q) * HayterMSAStructure(Q)
    """
    def setUp(self):
        from sas.models.LamellarModel import LamellarModel
        from sas.models.HayterMSAStructure import HayterMSAStructure
        from sas.models.MultiplicationModel import MultiplicationModel

        self.model = LamellarModel()
        self.model2 = HayterMSAStructure()
        self.model3 = MultiplicationModel(self.model, self.model2)  

    #Radius of model1.calculate_ER should Not be finite.
    def test_multplication_radius(self):
        """
            test multiplication model (check the effective radius & the output
             of the multiplication)
        """
        #Check run       
        self.assertFalse(numpy.isfinite(self.model3.run(0.1)))
        #check effective radius . 
        self.assertTrue(numpy.isfinite(self.model.calculate_ER()))