示例#1
0
    def test_round_trip(self):
        attr_dict = {
                        'value': "test_value",
                        'id': "test_a",
                        'idref': "test_b",
                        'datatype': "test_c",
                        'condition': "test_d",
                        'pattern_type': "test_e",
                        'regex_syntax': "test_f",
                        'start_range': "test_g",
                        'end_range': "test_h",
                        'value_set': ["test_i"],
                        'has_changed': "test_j",
                        'trend': "test_k",
                        'appears_random': "test_l",
                        'is_obfuscated': "test_m",
                        'obfuscation_algorithm_ref': "test_n",
                        'is_defanged': "test_o",
                        'defanging_algorithm_ref': "test_p",
                        'refanging_transform_type': "test_q",
                        'refanging_transform': "test_r",
                    }

        # Using `String` class explicity since the base `Attribute` class does
        # not define _get_binding_class()
        attr_obj = String.object_from_dict(attr_dict)
        attr_dict2 = String.dict_from_object(attr_obj)
        self.assertEqual(attr_dict, attr_dict2)