File: test_binding.py

package info (click to toggle)
python-xsdata 24.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,936 kB
  • sloc: python: 29,257; xml: 404; makefile: 27; sh: 6
file content (21 lines) | stat: -rw-r--r-- 670 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from unittest import TestCase

from xsdata.models.wsdl import Binding, BindingOperation


class BindingTests(TestCase):
    def test_unique_operations(self):
        binding = Binding(
            type="foo",
            operations=[
                BindingOperation(name="bar"),
                BindingOperation(name="bar"),
                BindingOperation(name="bar"),
                BindingOperation(name="foo"),
            ],
        )

        operations = list(binding.unique_operations())
        self.assertEqual(2, len(operations))
        self.assertEqual(binding.operations[2], operations[0])
        self.assertEqual(binding.operations[3], operations[1])