4 from yaml
.scanner
import Scanner
6 class TestTokens(test_appliance
.TestAppliance
):
16 # block_sequence_start: [[
17 # block_mapping_start: {{
19 # flow_sequence_start: [
20 # flow_sequence_end: ]
21 # flow_mapping_start: {
29 'DOCUMENT_START': '---',
30 'DOCUMENT_END': '...',
35 'BLOCK_SEQ_START': '[[',
36 'BLOCK_MAP_START': '{{',
38 'FLOW_SEQ_START': '[',
40 'FLOW_MAP_START': '{',
47 def _testTokens(self
, test_name
, data_filename
, tokens_filename
):
49 tokens2
= file(tokens_filename
, 'rb').read().split()
52 tokens1
= scanner
.scan(data_filename
, file(data_filename
, 'rb').read())
53 tokens1
= [self
.replaces
[t
] for t
in tokens1
]
54 self
.failUnlessEqual(tokens1
, tokens2
)
57 print "TOKENS1:", tokens1
58 print "TOKENS2:", tokens2
61 TestTokens
.add_tests('testTokens', '.data', '.tokens')