-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathtest.py
More file actions
22 lines (18 loc) · 678 Bytes
/
test.py
File metadata and controls
22 lines (18 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import ipuz
from genxword.control import Genxword
import tempfile
import os
def test_ipuz_export():
with tempfile.TemporaryDirectory() as temp:
# Move to a temporary directory so we don't clog up anything important
os.chdir(temp)
# Generate a simple crossword as .puz
gen = Genxword(auto=True, mixmode=False)
gen.wlist([
'land', 'successful', 'climb', 'yet', 'picture', 'traffic', 'skin', 'leadership', 'threaten', 'win'
], 10)
gen.grid_size()
gen.gengrid('test', 'z')
with open('test.ipuz') as fp:
# This does automatic validation
ipuz.read(''.join(fp.read()))