예제 #1
0
    def test_struct_ctor_pos(self):
        r = wfn.Rational(2, 4)

        self.assertEqual(r.Numerator, 2)
        self.assertEqual(r.Denominator, 4)
예제 #2
0
    def test_struct_ctor_mix(self):
        r = wfn.Rational(3, Denominator=6)

        self.assertEqual(r.Numerator, 3)
        self.assertEqual(r.Denominator, 6)
예제 #3
0
    def test_struct_ctor_dict(self):
        r = wfn.Rational({"Denominator": 2, "Numerator": 4})

        self.assertEqual(r.Numerator, 4)
        self.assertEqual(r.Denominator, 2)
예제 #4
0
    def test_struct_ctor_kwd(self):
        r = wfn.Rational(Denominator=2, Numerator=4)

        self.assertEqual(r.Numerator, 4)
        self.assertEqual(r.Denominator, 2)