Exemple #1
0
def test_set_substitute_method():
    '''Substitute: Properties containing functions are methods'''

    # System under Test
    substitute = Substitute()

    # Act: Configure
    substitute.name = lambda: 1

    # Act: Run
    name = substitute.name()

    # Assert
    assert_equal(name, 1)
Exemple #2
0
def test_set_substitute_property():
    '''Substitute: How to provide data from a property'''

    # System under Test
    substitute = Substitute()

    # Act: Configure
    substitute.name = 'Johannes'

    # Act: Run
    name = substitute.name

    # Assert
    assert_equal(name, 'Johannes')