()
| 129 | |
| 130 | |
| 131 | def test_FunctionCall(): |
| 132 | fun = Function(transformScale) |
| 133 | fun['scale'] = '1.0' |
| 134 | fun2 = Function(transformZOffset) |
| 135 | |
| 136 | # No args |
| 137 | assert_raises(TypeError, fun) # need 1 arg |
| 138 | assert_raises(TypeError, fun, 1, 2) # need 1 arg |
| 139 | call = fun('x') |
| 140 | # Test repr |
| 141 | exp = call.expression({fun: 'y'}) |
| 142 | assert_equal(exp, 'y(x)') |
| 143 | # Test sig |
| 144 | assert len(call._args) == 1 |
| 145 | # Test dependencies |
| 146 | assert_in(fun, call.dependencies()) |
| 147 | assert_in(call._args[0], call.dependencies()) |
| 148 | |
| 149 | # More args |
| 150 | call = fun(fun2('foo')) |
| 151 | # Test repr |
| 152 | exp = call.expression({fun: 'y', fun2: 'z'}) |
| 153 | assert_in('y(z(', exp) |
| 154 | # Test sig |
| 155 | assert len(call._args) == 1 |
| 156 | call2 = call._args[0] |
| 157 | assert len(call2._args) == 1 |
| 158 | # Test dependencies |
| 159 | assert_in(fun, call.dependencies()) |
| 160 | assert_in(call._args[0], call.dependencies()) |
| 161 | assert_in(fun2, call.dependencies()) |
| 162 | assert_in(call2._args[0], call.dependencies()) |
| 163 | |
| 164 | |
| 165 | def test_Variable(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…