(self)
| 81 | |
| 82 | class TestNetBuilder(unittest.TestCase): |
| 83 | def test_ops(self): |
| 84 | with NetBuilder() as nb: |
| 85 | y = _test_loop() |
| 86 | z, w, a, b = _test_outer() |
| 87 | p = _test_if(ops.Const(75)) |
| 88 | q = _test_if(ops.Const(25)) |
| 89 | plan = Plan('name') |
| 90 | plan.AddStep(to_execution_step(nb)) |
| 91 | ws = workspace.C.Workspace() |
| 92 | ws.run(plan) |
| 93 | expected_results = [ |
| 94 | (y, 5), |
| 95 | (z, False), |
| 96 | (w, True), |
| 97 | (a, False), |
| 98 | (b, False), |
| 99 | (p, 2), |
| 100 | (q, 3), |
| 101 | ] |
| 102 | for b, expected in expected_results: |
| 103 | actual = ws.blobs[str(b)].fetch() |
| 104 | self.assertEqual(actual, expected) |
| 105 | |
| 106 | def _expected_loop(self): |
| 107 | total = 0 |
nothing calls this directly
no test coverage detected