예제 #1
0
파일: core.py 프로젝트: marchon/pygeom
 def __init__(self, geometry):
     self.geometry = geometry
     if geometry is None:
         geom_form = []
     else:
         geom_form = list(geometry.form)
     form = list(self.form()) + geom_form
     if not all_equal([type(number) for number in form]):
         raise TypeError
예제 #2
0
 def __init__(self, geometry):
     self.geometry = geometry
     if geometry is None:
         geom_form = []
     else:
         geom_form = list(geometry.form)
     form = list(self.form()) + geom_form
     if not all_equal([type(number) for number in form]):
         raise TypeError
예제 #3
0
def test_all_equal():
    assert all_equal([])
    assert all_equal([1])
    assert all_equal([1, 1, 1])
    assert not all_equal([2, 1, 1, 1])
    assert not all_equal([1, 2])