Exemplo n.º 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')
Exemplo n.º 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/')
Exemplo n.º 3
0
 def test_no_schema(self):
     self.assertEqual({}, PageOperationMixin.parse_schema_yaml(u'Hello'))
Exemplo n.º 4
0
 def test_no_schema(self):
     self.assertEqual({}, PageOperationMixin.parse_schema_yaml(u'Hello'))
Exemplo n.º 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')
Exemplo n.º 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/')