File: some_module.py

package info (click to toggle)
python-flexmock 0.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: python: 3,802; makefile: 17; sh: 14
file content (59 lines) | stat: -rw-r--r-- 1,051 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
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
58
59
"""Bogus module for testing."""

# pylint: disable=missing-docstring,disallowed-name,invalid-name

MODULE_LEVEL_ATTRIBUTE = "test"


class SomeClass:
    CLASS_VALUE = "class_method"

    def __init__(self):
        self.instance_value = "instance_method"

    @classmethod
    def class_method(cls):
        return cls.CLASS_VALUE

    @classmethod
    def class_method_with_args(cls, a):
        return a

    @staticmethod
    def static_method():
        return "static_method"

    @staticmethod
    def static_method_with_args(a):
        return a

    def instance_method(self):
        return self.instance_value

    def instance_method_with_args(self, a):
        return a


class DerivedClass(SomeClass):
    pass


class ModuleClass:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def a(self):
        return self.x + self.y


def module_function(x, y):
    return x - y


def kwargs_only_func1(foo, *, bar, baz=5):
    return foo + bar + baz


def kwargs_only_func2(foo, *, bar, baz):
    return foo + bar + baz