Skip to content

Documentation Home Page

placeholder

A placeholder module for sample content

Sample

Sample class required to setup unittests and other checks

Source code in src/sample/placeholder.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Sample:
    """
    Sample class required to setup unittests and other checks
    """

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def sample_0(self) -> None:
        """
        Sample method that does nothing
        """
        return None

    def sample_1(self) -> str:
        """
        Sample method which returns the class name

        Returns:
            class name (str): str representation of class name
        """
        return self.__class__.__name__

    def sample_2(self, x: int) -> int:
        """
        Sample method which returns a random int between 0 and x

        Args:
            x (int): outer bound from zero

        Returns
            random int (int)
        """
        return randint(min(0, x), max(0, x))

    def sample_3(self) -> str:
        """
        Sample method which returns the string contents of a sql file

        Returns
            sql query (str)
        """
        with open(SQL_DIR / "query1.sql", "r") as infile:
            return infile.read()

sample_0()

Sample method that does nothing

Source code in src/sample/placeholder.py
22
23
24
25
26
def sample_0(self) -> None:
    """
    Sample method that does nothing
    """
    return None

sample_1()

Sample method which returns the class name

Returns:

Type Description
str

class name (str): str representation of class name

Source code in src/sample/placeholder.py
28
29
30
31
32
33
34
35
def sample_1(self) -> str:
    """
    Sample method which returns the class name

    Returns:
        class name (str): str representation of class name
    """
    return self.__class__.__name__

sample_2(x)

Sample method which returns a random int between 0 and x

Parameters:

Name Type Description Default
x int

outer bound from zero

required

Returns random int (int)

Source code in src/sample/placeholder.py
37
38
39
40
41
42
43
44
45
46
47
def sample_2(self, x: int) -> int:
    """
    Sample method which returns a random int between 0 and x

    Args:
        x (int): outer bound from zero

    Returns
        random int (int)
    """
    return randint(min(0, x), max(0, x))

sample_3()

Sample method which returns the string contents of a sql file

Returns sql query (str)

Source code in src/sample/placeholder.py
49
50
51
52
53
54
55
56
57
def sample_3(self) -> str:
    """
    Sample method which returns the string contents of a sql file

    Returns
        sql query (str)
    """
    with open(SQL_DIR / "query1.sql", "r") as infile:
        return infile.read()