Пример #1
0
    def test___nq__description(self):
        evidence1 = StepResultEvidence(name='foo',
                                       value='hello',
                                       description='test description')

        evidence2 = StepResultEvidence(name='foo',
                                       value='hello',
                                       description='bad')

        self.assertNotEqual(evidence1, evidence2)
Пример #2
0
    def test_as_dict_with_description(self):
        evidence = StepResultEvidence(name='foo',
                                      value='hello',
                                      description='test description')

        expected = {
            'description': 'test description',
            'name': 'foo',
            'value': 'hello'
        }
        self.assertEqual(expected, evidence.as_dict())
    def test_get_evidence_property(self):
        step_result = StepResult('step1', 'sub1', 'implementer1')
        step_result.add_evidence('evidence1', 'value1', 'description1')
        step_result.add_evidence('evidence2', 'value2')

        expected_evidence = {
            'evidence1':
            StepResultEvidence(name='evidence1',
                               value='value1',
                               description='description1'),
            'evidence2':
            StepResultEvidence(name='evidence2', value='value2')
        }

        self.assertEqual(step_result.evidence, expected_evidence)
    def test_add_duplicate_evidence(self):
        expected_evidence = {
            'evidence1':
            StepResultEvidence(name='evidence1',
                               value='value1',
                               description='description1'),
            'evidence2':
            StepResultEvidence(name='evidence2', value='lastonewins')
        }

        step_result = StepResult('step1', 'sub1', 'implementer1')
        step_result.add_evidence('evidence1', 'value1', 'description1')
        step_result.add_evidence('evidence2', 'here')
        step_result.add_evidence('evidence2', 'andhere')
        step_result.add_evidence('evidence2', 'lastonewins')
        self.assertEqual(step_result.evidence, expected_evidence)
Пример #5
0
    def test___repr__(self):
        evidence = StepResultEvidence(name='foo',
                                      value='hello',
                                      description='test description')

        expected = "StepResultEvidence(name=foo, value=hello, description=test description)"
        self.assertEqual(expected, repr(evidence))
Пример #6
0
    def test___str__(self):
        evidence = StepResultEvidence(name='foo',
                                      value='hello',
                                      description='test description')

        expected = "{'name': 'foo', 'value': 'hello', 'description': 'test description'}"
        self.assertEqual(expected, str(evidence))
    def test_add_evidence(self):
        step_result = StepResult('step1', 'sub1', 'implementer1')
        step_result.add_evidence('evidence1', 'value1', 'description1')
        step_result.add_evidence('evidence2', 'value2', 'description2')
        step_result.add_evidence('evidence3', 'value3')

        self.assertEqual(
            step_result.get_evidence('evidence1'),
            StepResultEvidence(name='evidence1',
                               value='value1',
                               description='description1'))
        self.assertEqual(
            step_result.get_evidence('evidence2'),
            StepResultEvidence(name='evidence2',
                               value='value2',
                               description='description2'))
        self.assertEqual(step_result.get_evidence('evidence3'),
                         StepResultEvidence(name='evidence3', value='value3'))
    def test_get_evidence(self):
        expected_evidence = StepResultEvidence(name='evidence1',
                                               value='value1',
                                               description='description1')

        step_result = StepResult('step1', 'sub1', 'implementer1')
        step_result.add_evidence('evidence1', 'value1', 'description1')
        self.assertEqual(step_result.get_evidence('evidence1'),
                         expected_evidence)
Пример #9
0
    def test_description(self):
        evidence = StepResultEvidence(name='foo',
                                      value='hello',
                                      description='test description')

        self.assertEqual("test description", evidence.description)
Пример #10
0
    def test_description_empty(self):
        evidence = StepResultEvidence(name='foo', value='hello')

        self.assertEqual("", evidence.description)
Пример #11
0
    def test_value(self):
        evidence = StepResultEvidence(name='foo', value='hello')

        self.assertEqual('hello', evidence.value)