mirror of
https://gitee.com/openharmony/third_party_pyyaml
synced 2025-03-02 07:47:08 +00:00
31 lines
818 B
Python
31 lines
818 B
Python
|
|
import test_appliance
|
|
|
|
class TestSyck(test_appliance.TestAppliance):
|
|
|
|
def _testSyckOnTokenTests(self, test_name, data_filename, tokens_filename):
|
|
try:
|
|
syck.parse(file(data_filename, 'rb'))
|
|
except:
|
|
print
|
|
print "DATA:"
|
|
print file(data_filename, 'rb').read()
|
|
raise
|
|
|
|
def _testSyckOnCanonicalTests(self, test_name, data_filename, canonical_filename):
|
|
try:
|
|
syck.parse(file(data_filename, 'rb'))
|
|
except:
|
|
print
|
|
print "DATA:"
|
|
print file(data_filename, 'rb').read()
|
|
raise
|
|
|
|
try:
|
|
import syck
|
|
#TestSyck.add_tests('testSyckOnTokenTests', '.data', '.tokens')
|
|
#TestSyck.add_tests('testSyckOnCanonicalTests', '.data', '.canonical')
|
|
except ImportError:
|
|
pass
|
|
|