Пример #1
0
    def test_that_falsy_options_are_evaluated_False(self):
        options_column_model = OptionsColumnModel('UseMirror=False')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})

        options_column_model = OptionsColumnModel('UseMirror=0')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})

        options_column_model = OptionsColumnModel('UseMirror=No')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})

        options_column_model = OptionsColumnModel('UseMirror=F')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})

        options_column_model = OptionsColumnModel('UseMirror=N')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})

        options_column_model = OptionsColumnModel('UseMirror=fAlSE')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': False})
Пример #2
0
    def test_that_truthy_options_are_evaluated_True(self):
        options_column_model = OptionsColumnModel('UseMirror=True')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})

        options_column_model = OptionsColumnModel('UseMirror=1')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})

        options_column_model = OptionsColumnModel('UseMirror=Yes')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})

        options_column_model = OptionsColumnModel('UseMirror=T')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})

        options_column_model = OptionsColumnModel('UseMirror=Y')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})

        options_column_model = OptionsColumnModel('UseMirror=tRuE')
        self.assertEqual(options_column_model.get_options(), {'UseMirror': True})