示例#1
0
        def given(self):
            from corejet.core.model import\
               RequirementsCatalogue,  Epic, Story, Scenario, Step

            self.catalogue = RequirementsCatalogue(project="Test project",
                extractTime=datetime.datetime(2011, 1, 2, 12, 1, 0),
                testTime=datetime.datetime(2011, 1, 2, 12, 5, 0))

            epic1 = Epic("E1", "First epic")
            self.catalogue.epics.append(epic1)

            epic2 = Epic("E2", "Second epic")
            self.catalogue.epics.append(epic2)

            story1 = Story("S1", "First story", points=3, status="open",
                priority="high", epic=epic1)
            epic1.stories.append(story1)

            story1.givens = [Step("some background", 'given'),
                             Step("more background", 'given')]

            story2 = Story("S2", "Second story", points=3, status="closed",
                resolution="fixed", priority="high", epic=epic1)
            epic1.stories.append(story2)

            scenario1 = Scenario("First scenario", story=story1,
                givens=[Step("something", 'given')],
                whens=[Step("something happens", 'when')],
                thens=[Step("do something", 'then'),
                       Step("and something else", 'then')],
                status="pass",
                )
            story1.scenarios.append(scenario1)

            scenario2 = Scenario("Second scenario", story=story2,
                givens=[Step("something", 'given')],
                whens=[Step("something happens", 'when')],
                thens=[Step("do something", 'then'),
                       Step("and something else", 'then')],
                status="mismatch",
                )
            story1.scenarios.append(scenario2)