File: test_testing.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 (16 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from unittest import TestCase

from tests.fixtures.books import BooksForm
from xsdata.utils.testing import load_class


class TestingTests(TestCase):
    def test_load(self):
        output = "Generating package: tests.fixtures.books.books"
        self.assertEqual(BooksForm, load_class(output, "BooksForm"))

    def test_load_class_raises_exception(self):
        output = "Generating package: generated.foo.bar"

        with self.assertRaises(ModuleNotFoundError):
            load_class(output, "foo")