def get_attrs_as_string(self):
        """
        FIXME: Find a better was to do this.

        >>> node = DocNode(attrs={'foo':"bar", "no":123})
        >>> node.get_attrs_as_string()
        'foo="bar" no=123'

        >>> node = DocNode(attrs={"foo":'bar', "no":"ABC"})
        >>> node.get_attrs_as_string()
        'foo="bar" no="ABC"'
        """
        return dict2string(self.attrs)
Esempio n. 2
0
    def get_attrs_as_string(self):
        """
        FIXME: Find a better was to do this.

        >>> node = DocNode(attrs={'foo':"bar", "no":123})
        >>> node.get_attrs_as_string()
        'foo="bar" no=123'

        >>> node = DocNode(attrs={"foo":'bar', "no":"ABC"})
        >>> node.get_attrs_as_string()
        'foo="bar" no="ABC"'
        """
        return dict2string(self.attrs)
Esempio n. 3
0
 def test_basic3(self):
     self.assertEqual(
         dict2string({"foo":'bar', "no":"ABC"}),
         'foo="bar" no="ABC"'
     )
Esempio n. 4
0
 def test_basic2(self):
     self.assertEqual(
         dict2string({'foo':"bar", "no":123}),
         'foo="bar" no=123'
     )
Esempio n. 5
0
 def test_basic(self):
     self.assertEqual(
         dict2string({'key':'value'}),
         'key="value"'
     )
Esempio n. 6
0
 def test_basic3(self):
     self.assertEqual(dict2string({
         "foo": 'bar',
         "no": "ABC"
     }), 'foo="bar" no="ABC"')
Esempio n. 7
0
 def test_basic2(self):
     self.assertEqual(dict2string({
         'foo': "bar",
         "no": 123
     }), 'foo="bar" no=123')
Esempio n. 8
0
 def test_basic(self):
     self.assertEqual(dict2string({'key': 'value'}), 'key="value"')
 def test_basic3(self):
     self.assertEqual(
         dict2string({"foo":'bar', "no":"ABC"}),
         "foo='bar' no='ABC'"
     )