Example #1
0
 def test_tab_and_space_mixed(self):
     body = u'\t#!yaml/schema\n    alternateName: hi\n\turl: http://x.com\n    name: "Hello"\n'
     data = PageOperationMixin.parse_schema_yaml(body)
     self.assertEqual(data['name'], u'Hello')
     self.assertEqual(data['alternateName'], u'hi')
     self.assertEqual(data['url'], u'http://x.com')
Example #2
0
 def test_re_match(self):
     body = u'''\t#!yaml/schema\n    url: "http://anotherfam.kr/"\n\n\n[[\uc81c\uc791\ub450\ub808]]\ub97c ...\n'''
     data = PageOperationMixin.parse_schema_yaml(body)
     self.assertEqual(data['url'], 'http://anotherfam.kr/')
Example #3
0
 def test_no_schema(self):
     self.assertEqual({}, PageOperationMixin.parse_schema_yaml(u'Hello'))
Example #4
0
 def test_no_schema(self):
     self.assertEqual({}, PageOperationMixin.parse_schema_yaml(u'Hello'))
Example #5
0
 def test_tab_and_space_mixed(self):
     body = u'\t#!yaml/schema\n    alternateName: hi\n\turl: http://x.com\n    name: "Hello"\n'
     data = PageOperationMixin.parse_schema_yaml(body)
     self.assertEqual(data['name'], u'Hello')
     self.assertEqual(data['alternateName'], u'hi')
     self.assertEqual(data['url'], u'http://x.com')
Example #6
0
 def test_re_match(self):
     body = u'''\t#!yaml/schema\n    url: "http://anotherfam.kr/"\n\n\n[[\uc81c\uc791\ub450\ub808]]\ub97c ...\n'''
     data = PageOperationMixin.parse_schema_yaml(body)
     self.assertEqual(data['url'], 'http://anotherfam.kr/')