예제 #1
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)
예제 #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)
예제 #3
0
 def test_basic3(self):
     self.assertEqual(
         dict2string({"foo":'bar', "no":"ABC"}),
         'foo="bar" no="ABC"'
     )
예제 #4
0
 def test_basic2(self):
     self.assertEqual(
         dict2string({'foo':"bar", "no":123}),
         'foo="bar" no=123'
     )
예제 #5
0
 def test_basic(self):
     self.assertEqual(
         dict2string({'key':'value'}),
         'key="value"'
     )
예제 #6
0
 def test_basic3(self):
     self.assertEqual(dict2string({
         "foo": 'bar',
         "no": "ABC"
     }), 'foo="bar" no="ABC"')
예제 #7
0
 def test_basic2(self):
     self.assertEqual(dict2string({
         'foo': "bar",
         "no": 123
     }), 'foo="bar" no=123')
예제 #8
0
 def test_basic(self):
     self.assertEqual(dict2string({'key': 'value'}), 'key="value"')
예제 #9
0
 def test_basic3(self):
     self.assertEqual(
         dict2string({"foo":'bar', "no":"ABC"}),
         "foo='bar' no='ABC'"
     )