Exemple #1
0
        class MongoDb:
            database = String()
            encryption = Boolean()
            encryptionKey = String()
            password = String()
            replicaSet = String()

            class Nested:
                key = Integer()
Exemple #2
0
class SuperNested(Configuration):
    __section__ = 'Spring.Data.MongoDb'

    database = String()
    encryption = Boolean()
    encryptionKey = String()
    password = String()
    replicaSet = String()

    class Nested:
        key = Integer()
Exemple #3
0
    def test_convert_throws_exception_when_not_string(self):
        with self.assertRaises(Exception) as context:
            Boolean().convert(543234)

        self.assertTrue('Invalid literal for boolean. Not a string: 543234' in
                        str(context.exception))
Exemple #4
0
    def test_convert_converts_string_not_yes_true_t_1(self):
        actual = Boolean().convert('fjkdsla;')

        self.assertEqual(actual, False)
Exemple #5
0
    def test_convert_converts_string_false(self):
        actual = Boolean().convert('false')

        self.assertEqual(actual, False)
Exemple #6
0
    def test_convert_converts_string_one(self):
        actual = Boolean().convert('1')

        self.assertEqual(actual, True)
Exemple #7
0
    def test_convert_converts_string_yes_different_case(self):
        actual = Boolean().convert('YES')

        self.assertEqual(actual, True)
Exemple #8
0
    def test_convert_converts_boolean_False(self):
        actual = Boolean().convert(False)

        self.assertEqual(actual, False)
Exemple #9
0
    def test_convert_converts_boolean_True(self):
        actual = Boolean().convert(True)

        self.assertEqual(actual, True)
Exemple #10
0
class Lower(Configuration):
    CaseSection = Boolean()