示例#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)