78 def test_file_fields(self): |
78 def test_file_fields(self): |
79 data_format_field = guess_field(schema['File'], schema['data_format']) |
79 data_format_field = guess_field(schema['File'], schema['data_format']) |
80 self.assertEquals(data_format_field, None) |
80 self.assertEquals(data_format_field, None) |
81 data_encoding_field = guess_field(schema['File'], schema['data_encoding']) |
81 data_encoding_field = guess_field(schema['File'], schema['data_encoding']) |
82 self.assertEquals(data_encoding_field, None) |
82 self.assertEquals(data_encoding_field, None) |
|
83 data_name_field = guess_field(schema['File'], schema['data_name']) |
|
84 self.assertEquals(data_name_field, None) |
83 |
85 |
84 data_field = guess_field(schema['File'], schema['data']) |
86 data_field = guess_field(schema['File'], schema['data']) |
85 self.assertIsInstance(data_field, FileField) |
87 self.assertIsInstance(data_field, FileField) |
86 self.assertEquals(data_field.required, True) |
88 self.assertEquals(data_field.required, True) |
87 self.assertIsInstance(data_field.format_field, StringField) |
89 self.assertIsInstance(data_field.format_field, StringField) |
88 self.assertIsInstance(data_field.encoding_field, StringField) |
90 self.assertIsInstance(data_field.encoding_field, StringField) |
|
91 self.assertIsInstance(data_field.name_field, StringField) |
89 |
92 |
90 def test_constraints_priority(self): |
93 def test_constraints_priority(self): |
91 salesterm_field = guess_field(schema['Salesterm'], schema['reason']) |
94 salesterm_field = guess_field(schema['Salesterm'], schema['reason']) |
92 constraints = schema['reason'].rproperty('Salesterm', 'String', 'constraints') |
95 constraints = schema['reason'].rproperty('Salesterm', 'String', 'constraints') |
93 self.assertEquals([c.__class__ for c in constraints], |
96 self.assertEquals([c.__class__ for c in constraints], |