示例#1
0
    def test_polygon_area(self):
        """test some polygon_area"""

        assert_almost_equal(polygon_area(self.shp['unit square']),1)
        assert_almost_equal(polygon_area(self.shp['right tri']),0.5)
        assert_almost_equal(polygon_area(self.shp['octahedral tri']),0.8660254)
        assert_almost_equal(polygon_area(self.shp['3D tri']),4.82182538)
    def test_polygon_area(self):
        """test some polygon_area"""

        assert_almost_equal(polygon_area(self.shp['unit square']), 1)
        assert_almost_equal(polygon_area(self.shp['right tri']), 0.5)
        assert_almost_equal(polygon_area(self.shp['octahedral tri']),
                            0.8660254)
        assert_almost_equal(polygon_area(self.shp['3D tri']), 4.82182538)
示例#3
0
def test_m_func_bc_1v1():
    """m_func tests using global vars, i = 0, boundary = 1"""        
    m0 = m_func(0, 1)    
    assert_almost_equal(m0, PTIB[0], 5)
示例#4
0
def test_m_func_bc_0v1():
    """m_func tests using global vars, i = 0, boundary = 0"""       
        
    m0 = m_func(0, 0)    
    assert_almost_equal(m0, PTPB[0], 5)
示例#5
0
 def test_bc1(self): 
     """test i = 0, boundary = 1"""
     m0 = m_func(0,1)    
     assert_almost_equal(m0, self.PTIB[0], 5)
示例#6
0
 def test_bc0(self):
     """test i = 0, boundary = 0"""
     m0 = m_func(0,0)    
     assert_almost_equal(m0, self.PTPB[0], 5)
示例#7
0
def test_m_from_sin_mx_bc_0v2():
    """m_from_sin_mx tests, self contained, i = 0, boundary = 0"""
    m0 = m_from_sin_mx(0, 0)
    assert_almost_equal(m0, 3.14159, 5)
示例#8
0
 def test_bc1(self):
     """test i = 0, boundary = 1"""
     m0 = m_func(0, 1)
     assert_almost_equal(m0, self.PTIB[0], 5)
示例#9
0
def test_m_from_sin_mx_bc_1v2():
    """m_from_sin_mx tests, self contained, i = 0, boundary = 1"""
    m0 = m_from_sin_mx(0, 1)
    assert_almost_equal(m0, 1.57080, 5)
示例#10
0
def test_m_func_bc_1v2():
    """m_func tests, self contained, i = 0, boundary = 1"""
    m0 = m_func(0, 1)
    assert_almost_equal(m0, 1.57080, 5)
示例#11
0
def test_m_func_bc_0v2():
    """m_func tests, self contained, i = 0, boundary = 0"""
    m0 = m_func(0, 0)
    assert_almost_equal(m0, 3.14159, 5)
示例#12
0
def test_m_func_bc_1v1():
    """m_func tests using global vars, i = 0, boundary = 1"""
    m0 = m_func(0, 1)
    assert_almost_equal(m0, PTIB[0], 5)
示例#13
0
def test_m_func_bc_0v1():
    """m_func tests using global vars, i = 0, boundary = 0"""

    m0 = m_func(0, 0)
    assert_almost_equal(m0, PTPB[0], 5)
示例#14
0
def test_m_func_bc_0v2():
    """m_func tests, self contained, i = 0, boundary = 0"""        
    m0 = m_func(0, 0)    
    assert_almost_equal(m0, 3.14159, 5)
示例#15
0
def test_m_from_sin_mx_bc_1v1():
    """m_from_sin_mx tests using global vars, i = 0, boundary = 1"""
    m0 = m_from_sin_mx(0, 1)
    assert_almost_equal(m0, PTIB[0], 5)
示例#16
0
def test_m_func_bc_1v2():        
    """m_func tests, self contained, i = 0, boundary = 1"""
    m0 = m_func(0, 1)    
    assert_almost_equal(m0, 1.57080, 5)
示例#17
0
 def test_bc0(self):
     """test i = 0, boundary = 0"""
     m0 = m_func(0, 0)
     assert_almost_equal(m0, self.PTPB[0], 5)