Ejemplo n.º 1
0
    def test_get_attribute_by_id_with_bad_id(self):
        a1 = Attribute('a', 'b')
        a2 = Attribute('b', 'b2')
        attributes = [a1, a2]
        report = Report('redfang', attributes=attributes)

        a = report.get_attribute_by_id('a')
        self.assertEqual(a.value, 'b')

        bad_a = report.get_attribute_by_id('id_that_does_not_exist')
        self.assertIsNone(bad_a)
Ejemplo n.º 2
0
    def test_get_attribute_by_id_with_bad_id(self):
        a1 = Attribute('a', 'b')
        a2 = Attribute('b', 'b2')
        attributes = [a1, a2]
        report = Report('redfang', attributes=attributes)

        a = report.get_attribute_by_id('a')
        self.assertEqual(a.value, 'b')

        bad_a = report.get_attribute_by_id('id_that_does_not_exist')
        self.assertIsNone(bad_a)
Ejemplo n.º 3
0
    def test_get_attribute_by_id_with_bad_id(self):
        a1 = Attribute('a', 'b')
        a2 = Attribute('b', 'b2')
        attributes = [a1, a2]
        report = Report('redfang', attributes=attributes)

        a = report.get_attribute_by_id('a')
        assert a.value == 'b'

        bad_a = report.get_attribute_by_id('id_that_does_not_exist')
        assert bad_a is None
Ejemplo n.º 4
0
    def test_get_attribute_by_id_with_bad_id(self):
        a1 = Attribute("a", "b")
        a2 = Attribute("b", "b2")
        attributes = [a1, a2]
        report = Report("redfang", attributes=attributes)

        a = report.get_attribute_by_id("a")
        self.assertEqual(a.value, "b")

        bad_a = report.get_attribute_by_id("id_that_does_not_exist")
        self.assertIsNone(bad_a)
Ejemplo n.º 5
0
    def test_get_attribute_by_id(self):
        a = Attribute('a', 'b')
        a2 = Attribute('b', 'b2')
        attributes = [a, a2]
        r = Report('redfang', attributes=attributes)

        a1 = r.get_attribute_by_id('a')

        self.assertEqual(a, a1)
Ejemplo n.º 6
0
    def test_get_attribute_by_id(self):
        a = Attribute('a', 'b')
        a2 = Attribute('b', 'b2')
        attributes = [a, a2]
        r = Report('redfang', attributes=attributes)

        a1 = r.get_attribute_by_id('a')

        self.assertEqual(a, a1)
Ejemplo n.º 7
0
    def test_get_attribute_by_id(self):
        a = Attribute("a", "b")
        a2 = Attribute("b", "b2")
        attributes = [a, a2]
        r = Report("redfang", attributes=attributes)

        a1 = r.get_attribute_by_id("a")

        self.assertEqual(a, a1)