Пример #1
0
 def test_adder_exact(self):
     c1 = Cell(content=Supported(3))
     c2 = Cell(content=Supported(4))
     c3 = Cell()
     adder(c1, c2, c3)
     scheduler.run()
     self.assertEqual(c3.content, Supported(7))
Пример #2
0
    def test_str(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content('15')
        b.add_content('13')

        scheduler.run()

        self.assertEqual(c.content, '1513')
Пример #3
0
    def test_float(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content(1.5)
        b.add_content(1.3)

        scheduler.run()

        self.assertEqual(c.content, 2.8)
Пример #4
0
    def test_integer(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content(15)
        b.add_content(13)

        scheduler.run()

        self.assertEqual(c.content, 28)
Пример #5
0
    def test_str(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content('15')
        b.add_content('13')

        scheduler.run()

        self.assertEqual(c.content, '1513')
Пример #6
0
    def test_float(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content(1.5)
        b.add_content(1.3)

        scheduler.run()

        self.assertEqual(c.content, 2.8)
Пример #7
0
    def test_integer(self):
        a = Cell()
        b = Cell()
        c = Cell()

        adder(a, b, c)

        a.add_content(15)
        b.add_content(13)

        scheduler.run()

        self.assertEqual(c.content, 28)