示例#1
0
    def test_checking_object_and_subtable_sharing_localized_name(self):
        """
        It's valid for an object and a sub-table to share the localized name.

        """
        st1 = SymbolTable(
            "global",
            (Bind("current_day", BoolVar(), es="hoy"), ),
            SymbolTable("today", (), es="hoy"),
        )
        st2 = SymbolTable(
            "global",
            (Bind("current_day", BoolVar(), es="hoy"), ),
            # This sub-name will be called "hoy" in Spanish too:
            SymbolTable("hoy", ()),
        )
        eq_(st1.validate_scope(), None)
        eq_(st2.validate_scope(), None)
示例#2
0
 def test_checking_object_and_subtable_sharing_localized_name(self):
     """
     It's valid for an object and a sub-table to share the localized name.
     
     """
     st1 = SymbolTable("global",
         (
             Bind("current_day", BoolVar(), es="hoy"),
         ),
         SymbolTable("today", (), es="hoy"),
     )
     st2 = SymbolTable("global",
         (
             Bind("current_day", BoolVar(), es="hoy"),
         ),
         # This sub-name will be called "hoy" in Spanish too:
         SymbolTable("hoy", ()),
     )
     eq_(st1.validate_scope(), None)
     eq_(st2.validate_scope(), None)
示例#3
0
    def test_checking_object_and_subtable_sharing_global_name(self):
        """
        It's valid for an object and a sub-table to share the global name.

        """
        st = SymbolTable(
            "global",
            (Bind("today", BoolVar()), ),
            SymbolTable("today", ()),
        )
        eq_(st.validate_scope(), None)
示例#4
0
 def test_checking_object_and_subtable_sharing_global_name(self):
     """
     It's valid for an object and a sub-table to share the global name.
     
     """
     st = SymbolTable("global",
         (
             Bind("today", BoolVar()),
         ),
         SymbolTable("today", ()),
     )
     eq_(st.validate_scope(), None)
示例#5
0
 def test_checking_valid_table(self):
     st = SymbolTable("global",
         # Bindings/global objects:
         (
          Bind("bool", BoolVar(), es="booleano"),
          Bind("traffic", TrafficLightVar(), es=u"tráfico"),
         ),
         # Sub-tables:
         SymbolTable("maths",
             (
              Bind("pi", Number(3.1416)),
              Bind("e", Number(2.7183)),
             ),
         ),
     )
     eq_(st.validate_scope(), None)
示例#6
0
 def test_checking_valid_table(self):
     st = SymbolTable(
         "global",
         # Bindings/global objects:
         (
             Bind("bool", BoolVar(), es="booleano"),
             Bind("traffic", TrafficLightVar(), es=u"tráfico"),
         ),
         # Sub-tables:
         SymbolTable(
             "maths",
             (
                 Bind("pi", Number(3.1416)),
                 Bind("e", Number(2.7183)),
             ),
         ),
     )
     eq_(st.validate_scope(), None)