Ejemplo n.º 1
0
 def test_get_flags_list_of_dicts(self):
     source = SettingsFlagsSource()
     flags = source.get_flags()
     self.assertEqual(
         flags, {'MY_FLAG': [
             Condition('boolean', True, required=True),
         ]})
Ejemplo n.º 2
0
 def test_get_flags_two_tuple(self):
     source = SettingsFlagsSource()
     flags = source.get_flags()
     self.assertEqual(
         flags, {'MY_FLAG': [
             Condition('boolean', True, required=False),
         ]})
Ejemplo n.º 3
0
 def test_get_flags_list_of_dicts_without_required(self):
     source = SettingsFlagsSource()
     flags = source.get_flags()
     self.assertEqual(
         flags,
         {"MY_FLAG": [Condition("boolean", True, required=False)]},
     )
Ejemplo n.º 4
0
 def test_get_flags_two_tuple(self):
     source = SettingsFlagsSource()
     flags = source.get_flags()
     self.assertEqual(
         flags,
         {"MY_FLAG": [Condition("boolean", True, required=False)]},
     )
Ejemplo n.º 5
0
    def test_get_flags_dict(self):
        source = SettingsFlagsSource()
        with warnings.catch_warnings(record=True) as warning_list:
            flags = source.get_flags()
            self.assertTrue(
                any(item.category == FutureWarning for item in warning_list))

        self.assertEqual(
            flags, {'MY_FLAG': [
                Condition('boolean', True, required=False),
            ]})