コード例 #1
0
 def test_bool_resource_parameter_custom_text(self):
     param = BoolResourceParameter(true_text="Custom1",
                                   false_text="Custom2")
     self.assertEqual({
         "yes": "Custom1",
         "no": "Custom2"
     }, param.valid_values)
コード例 #2
0
 def get_additional_options(cls):
     """Additional options for BinaryCardsResourceGenerator."""
     return {
         "display_numbers":
         BoolResourceParameter(name="display_numbers",
                               description=_("Display Numbers"),
                               default=True),
         "black_back":
         BoolResourceParameter(
             name="black_back",
             description=_("Black on Card Back"),
             default=False,
             true_text=
             _("Yes - Uses a lot of black ink, but conveys clearer card state. Print double sided."
               ),
             false_text=_("No - Print single sided."))
     }
コード例 #3
0
 def get_additional_options(cls):
     """Additional options for BinaryCardsSmallResourceGenerator."""
     return {
         "number_bits":
         EnumResourceParameter(name="number_bits",
                               description=_("Number of Bits"),
                               values=NUMBER_BITS_VALUES,
                               default="4"),
         "dot_counts":
         BoolResourceParameter(
             name="dot_counts",
             description=_("Display Dot Counts"),
             default=True,
         ),
         "black_back":
         BoolResourceParameter(
             name="black_back",
             description=_("Black on Card Back"),
             default=False,
             true_text=
             _("Yes - Uses a lot of black ink, but conveys clearer card state. Print double sided."
               ),
             false_text=_("No - Print single sided."))
     }
コード例 #4
0
 def get_additional_options(cls):
     """Additional options for SearchingCardsResourceGenerator."""
     return {
         "number_cards":
         EnumResourceParameter(name="number_cards",
                               description=_("Number of cards"),
                               values=NUMBER_CARDS_VALUES,
                               default="15"),
         "max_number":
         EnumResourceParameter(name="max_number",
                               description=_("Range of numbers"),
                               values=MAX_NUMBER_VALUE,
                               default="number"),
         "help_sheet":
         BoolResourceParameter(name="help_sheet",
                               description=_("Include teacher guide sheet"),
                               default=True),
     }
コード例 #5
0
 def get_additional_options(cls):
     """Additional options for BinaryWindowsResourceGenerator."""
     return {
         "number_bits":
         EnumResourceParameter(name="number_bits",
                               description=_("Number of Bits"),
                               values=NUMBER_BITS_VALUES,
                               default="4"),
         "dot_counts":
         BoolResourceParameter(name="dot_counts",
                               description=_("Display Dot Counts"),
                               default=True),
         "value_type":
         EnumResourceParameter(name="value_type",
                               description=_("Value Representation"),
                               values=VALUE_TYPE_VALUES,
                               default="binary"),
     }
コード例 #6
0
 def get_additional_options(cls):
     """Additional options for TreasureHuntResourceGenerator."""
     return {
         "prefilled_values":
         EnumResourceParameter(name="prefilled_values",
                               description=_("Prefill with Numbers"),
                               values=PREFILLED_VALUES_VALUES,
                               default="easy"),
         "number_order":
         EnumResourceParameter(name="number_order",
                               description=_("Numbers Unsorted/Sorted"),
                               values=NUMBER_ORDER_VALUES,
                               default="sorted"),
         "instructions":
         BoolResourceParameter(name="instructions",
                               description=_("Include instruction sheets"),
                               default=True),
         "art":
         EnumResourceParameter(name="art",
                               description=_("Printing mode"),
                               values=ART_VALUES,
                               default="bw"),
     }
コード例 #7
0
 def test_bool_resource_parameter_process_value_invalid(self):
     param = BoolResourceParameter()
     with self.assertRaises(QueryParameterInvalidError):
         param.process_value("invalid")
コード例 #8
0
 def test_bool_resource_parameter_process_value_valid(self):
     param = BoolResourceParameter()
     self.assertEqual(True, param.process_value("yes"))
     self.assertEqual(False, param.process_value("no"))
コード例 #9
0
 def test_bool_resource_parameter_default_text(self):
     param = BoolResourceParameter()
     self.assertEqual({"yes": "Yes", "no": "No"}, param.valid_values)