Exemplo n.º 1
0
    def test_set_scale(self):
        for ct in self.ctypeS:
            print(ct)

            l = Landmark(ctype=ct)
            l.scale = 1
            nose.tools.assert_equal(l.scale, 1)

            l.scale = 2
            nose.tools.assert_equal(l.scale, 2)

            l.scale = 2.456
            nose.tools.assert_almost_equal(l.scale, 2.456, 6)

            l.scale = -2
            nose.tools.assert_almost_equal(l.scale, -2, 6)
Exemplo n.º 2
0
    def test_set_scale(self):
        for ct in self.C_TYPES:
            print ct

            l = Landmark(c_type=ct)
            l.scale = 1
            nose.tools.assert_equal(l.scale, 1)

            l.scale = 2
            nose.tools.assert_equal(l.scale, 2)

            l.scale = 2.456
            nose.tools.assert_almost_equal(l.scale, 2.456, 6)

            l.scale = -2
            nose.tools.assert_almost_equal(l.scale, -2, 6)

            def t():
                l.scale = 'foo'
            nose.tools.assert_raises(ctypes.ArgumentError, t)