예제 #1
0
파일: test_core.py 프로젝트: zbuc/lettuce
def test_step_represent_string_when_not_defined():
    "Step.represent_string behaviour when not defined"

    class FakeFeature:
        max_length = 10

    class FakeScenario:
        feature = FakeFeature

    relative_path = core.fs.relpath(__file__)
    step = core.Step('some sentence', '', 239, __file__)
    step.scenario = FakeScenario

    assert_equals(step.represent_string('test'),
                  "    test   # %s:239\n" % relative_path)
예제 #2
0
파일: test_core.py 프로젝트: zbuc/lettuce
def test_step_represent_string_when_defined():
    "Step.represent_string behaviour when defined"

    class FakeFeature:
        max_length = 10

    class FakeScenario:
        feature = FakeFeature

    class FakeScenarioDefinition:
        line = 421
        file = 'should/be/filename'

    step = core.Step('some sentence', '', 239, "not a file")
    step.scenario = FakeScenario
    step.defined_at = FakeScenarioDefinition
    assert_equals(step.represent_string('foobar'),
                  "    foobar # should/be/filename:421\n")