|
1 | | -from python_helper import log |
| 1 | +from python_helper import log, Test |
2 | 2 | from python_framework import Serializer |
3 | 3 | from python_framework import SqlAlchemyProxy as sap |
4 | 4 |
|
@@ -51,18 +51,19 @@ class Child(MODEL) : |
51 | 51 | father, fatherId = sap.getManyToOne(__tablename__, SELF_REFERENCE_FATHER_NAME, MODEL) |
52 | 52 | brother, brotherId = sap.getOneToOneChild(__tablename__, BROTHER_NAME, MODEL) |
53 | 53 |
|
| 54 | +@Test() |
54 | 55 | def Serializer_isModelTest() : |
55 | 56 | assert False == Serializer.isModel(generatorFunction()) |
56 | 57 | assert False == Serializer.isModel(MyClass()) |
57 | 58 | assert True == Serializer.isModel(MyEntityClass()) |
58 | | - log.debug(Serializer_isModelTest, 'Success') |
59 | 59 |
|
| 60 | +@Test() |
60 | 61 | def Serializer_isJsonifyable() : |
61 | 62 | assert False == Serializer.isJsonifyable(generatorFunction()) |
62 | 63 | assert True == Serializer.isJsonifyable(MyClass()) |
63 | 64 | assert True == Serializer.isJsonifyable(MyEntityClass()) |
64 | | - log.debug(Serializer_isJsonifyable, 'Success') |
65 | 65 |
|
| 66 | +@Test() |
66 | 67 | def Serializer_jsonifyIt() : |
67 | 68 | assert '{"myString": "myValue", "myInteger": 0, "myFloat": 0.099}' == Serializer.jsonifyIt(MY_DICTIONARY) |
68 | 69 |
|
@@ -117,5 +118,3 @@ def Serializer_jsonifyIt() : |
117 | 118 | myClass.myAttribute = myAttributeClass |
118 | 119 | assert '{"myAttribute": {"myClass": null, "myNeutralClassAttribute": "someOtherString"}, "myNeutralAttribute": "someString"}' == Serializer.jsonifyIt(myClass) |
119 | 120 | assert '{"myClass": {"myAttribute": null, "myNeutralAttribute": "someString"}, "myNeutralClassAttribute": "someOtherString"}' == Serializer.jsonifyIt(myClass.myAttribute) |
120 | | - |
121 | | - log.debug(Serializer_jsonifyIt, 'Success') |
0 commit comments