|
9 | 9 | cur_dir = os.path.dirname(os.path.abspath(__file__))
|
10 | 10 |
|
11 | 11 |
|
| 12 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
12 | 13 | def test_visualization_with_yml_file_img(tmpdir):
|
13 | 14 | Flow.load_config(
|
14 | 15 | os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml')
|
15 | 16 | ).plot(output=os.path.join(tmpdir, 'flow.svg'))
|
16 | 17 | assert os.path.exists(os.path.join(tmpdir, 'flow.svg'))
|
17 | 18 |
|
18 | 19 |
|
| 20 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
19 | 21 | def test_visualization_with_yml_file_jpg(tmpdir):
|
20 | 22 | Flow.load_config(
|
21 | 23 | os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml')
|
22 | 24 | ).plot(output=os.path.join(tmpdir, 'flow.jpg'))
|
23 | 25 | assert os.path.exists(os.path.join(tmpdir, 'flow.jpg'))
|
24 | 26 |
|
25 | 27 |
|
| 28 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
26 | 29 | def test_visualization_with_yml_file_jpg_lr(tmpdir):
|
27 | 30 | Flow.load_config(
|
28 | 31 | os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml')
|
29 | 32 | ).plot(output=os.path.join(tmpdir, 'flow-hor.jpg'), vertical_layout=False)
|
30 | 33 | assert os.path.exists(os.path.join(tmpdir, 'flow-hor.jpg'))
|
31 | 34 |
|
32 | 35 |
|
| 36 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
33 | 37 | def test_visualization_plot_twice(tmpdir):
|
34 | 38 | (
|
35 | 39 | Flow()
|
36 |
| - .add(name='pod_a') |
37 |
| - .plot(output=os.path.join(tmpdir, 'flow1.svg')) |
38 |
| - .add(name='pod_b', needs='gateway') |
39 |
| - .needs(['pod_a', 'pod_b']) |
40 |
| - .plot(output=os.path.join(tmpdir, 'flow2.svg')) |
| 40 | + .add(name='pod_a') |
| 41 | + .plot(output=os.path.join(tmpdir, 'flow1.svg')) |
| 42 | + .add(name='pod_b', needs='gateway') |
| 43 | + .needs(['pod_a', 'pod_b']) |
| 44 | + .plot(output=os.path.join(tmpdir, 'flow2.svg')) |
41 | 45 | )
|
42 | 46 |
|
43 | 47 | assert os.path.exists(os.path.join(tmpdir, 'flow1.svg'))
|
44 | 48 | assert os.path.exists(os.path.join(tmpdir, 'flow2.svg'))
|
45 | 49 |
|
46 | 50 |
|
| 51 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
47 | 52 | def test_visualization_plot_in_middle(tmpdir):
|
48 | 53 | (
|
49 | 54 | Flow()
|
50 |
| - .add(name='pod_a') |
51 |
| - .plot(output=os.path.join(tmpdir, 'flow3.svg')) |
52 |
| - .add(name='pod_b', needs='gateway') |
53 |
| - .needs(['pod_a', 'pod_b']) |
| 55 | + .add(name='pod_a') |
| 56 | + .plot(output=os.path.join(tmpdir, 'flow3.svg')) |
| 57 | + .add(name='pod_b', needs='gateway') |
| 58 | + .needs(['pod_a', 'pod_b']) |
54 | 59 | )
|
55 | 60 |
|
56 | 61 | assert os.path.exists(os.path.join(tmpdir, 'flow3.svg'))
|
57 | 62 |
|
58 | 63 |
|
| 64 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
59 | 65 | def test_flow_before_after_plot(tmpdir):
|
60 |
| - |
61 | 66 | Flow().add(uses_before=Executor, uses_after=Executor, name='p1').plot(
|
62 | 67 | os.path.join(tmpdir, 'flow.svg')
|
63 | 68 | )
|
64 | 69 | assert os.path.exists(os.path.join(tmpdir, 'flow.svg'))
|
65 | 70 |
|
66 | 71 |
|
| 72 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
67 | 73 | def test_flow_before_plot(tmpdir):
|
68 | 74 | Flow().add(uses_before=Executor, name='p1').plot(os.path.join(tmpdir, 'flow.svg'))
|
69 | 75 | assert os.path.exists(os.path.join(tmpdir, 'flow.svg'))
|
70 | 76 |
|
71 | 77 |
|
| 78 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
72 | 79 | def test_flow_after_plot(tmpdir):
|
73 | 80 | Flow().add(uses_after=Executor, name='p1').plot(os.path.join(tmpdir, 'flow.svg'))
|
74 | 81 | assert os.path.exists(os.path.join(tmpdir, 'flow.svg'))
|
75 | 82 |
|
76 | 83 |
|
| 84 | +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") |
77 | 85 | @pytest.mark.parametrize('vertical_layout', [True, False])
|
78 | 86 | def test_flow_vertical(tmpdir, vertical_layout):
|
79 | 87 | def get_image_size(fname):
|
@@ -114,11 +122,3 @@ def get_image_size(fname):
|
114 | 122 | assert w_h is not None
|
115 | 123 | w, h = w_h
|
116 | 124 | assert (w < h) == vertical_layout
|
117 |
| - |
118 |
| - |
119 |
| -def test_flow_plot_after_build(): |
120 |
| - f = Flow().add().add() |
121 |
| - with f: |
122 |
| - f.plot() |
123 |
| - |
124 |
| - f.plot() |
0 commit comments