File: utils.py

package info (click to toggle)
asciidoc 10.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,060 kB
  • sloc: xml: 17,324; python: 8,192; javascript: 4,101; sh: 451; makefile: 110
file content (17 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pathlib import Path

TEST_DIR = Path(__file__).resolve().parent / '__test_data__'


class Struct:
    """
    Use this to make "mock" version of asciidoc classes. Usage is passing in kwargs,
    and these are set to the properties of the class.

    >>> a = Struct(foo=1, bar=2)
    >>> a.foo
    1
    >>> a.bar
    2
    """
    def __init__(self, **entries): self.__dict__.update(entries)