(self)
| 912 | |
| 913 | # custom stipples and line styles |
| 914 | def test_6(self): |
| 915 | |
| 916 | if not can_create_layoutview(): |
| 917 | print("Skipped test as LayoutView cannot be created.") |
| 918 | return |
| 919 | |
| 920 | cv = pya.LayoutView() |
| 921 | cv.load_layout(os.getenv("TESTSRC") + "/testdata/gds/t11.gds", True) |
| 922 | |
| 923 | cv.clear_stipples() |
| 924 | |
| 925 | self.assertEqual(cv.get_stipple(0), "*\n") |
| 926 | |
| 927 | index = cv.add_stipple("something", [ 0x1, 0x2, 0x4, 0x8 ], 4) |
| 928 | self.assertEqual(cv.get_stipple(index), "...*\n..*.\n.*..\n*...\n") |
| 929 | |
| 930 | cv.remove_stipple(index) |
| 931 | self.assertEqual(cv.get_stipple(index), "*\n") |
| 932 | |
| 933 | index = cv.add_stipple("something", ".**.\n*..*\n.*.*\n*.*.") |
| 934 | self.assertEqual(cv.get_stipple(index), ".**.\n*..*\n.*.*\n*.*.\n") |
| 935 | |
| 936 | cv.clear_stipples() |
| 937 | self.assertEqual(cv.get_stipple(index), "*\n") |
| 938 | |
| 939 | cv.clear_line_styles() |
| 940 | |
| 941 | self.assertEqual(cv.get_line_style(0), "") |
| 942 | |
| 943 | index = cv.add_line_style("something", 0x5, 4) |
| 944 | self.assertEqual(cv.get_line_style(index), "*.*.") |
| 945 | |
| 946 | cv.remove_line_style(index) |
| 947 | self.assertEqual(cv.get_line_style(index), "") |
| 948 | |
| 949 | index = cv.add_line_style("something", ".**.*..*") |
| 950 | self.assertEqual(cv.get_line_style(index), ".**.*..*") |
| 951 | |
| 952 | cv.clear_line_styles() |
| 953 | self.assertEqual(cv.get_line_style(index), "") |
| 954 | |
| 955 | cv._destroy() |
| 956 | |
| 957 | |
| 958 | # run unit tests |
nothing calls this directly
no test coverage detected