<s> import unittest <EOL> import arff <EOL> class TestDecodeRelation ( unittest . TestCase ) : <EOL> def get_decoder ( self ) : <EOL> decoder = arff . ArffDecoder ( ) <EOL> return decoder <EOL> def test_simple ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> def test_padding ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> def test_quotes ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> fixture = u"<STR_LIT>" <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> def test_quotes_and_special ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> fixture = u"<STR_LIT>" <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> def test_spaces ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> fixture = u"<STR_LIT>" <EOL> result = decoder . _decode_relation ( fixture ) <EOL> expected = u'<STR_LIT>' <EOL> self . assertEqual ( result , expected ) <EOL> def test_invalid_spaces ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> self . assertRaises ( <EOL> arff . BadRelationFormat , <EOL> decoder . _decode_relation , <EOL> fixture <EOL> ) <EOL> def test_invalid_characters ( self ) : <EOL> '''<STR_LIT>''' <EOL> decoder = self . get_decoder ( ) <EOL> fixture = u'<STR_LIT>' <EOL> self . assertRaises ( <EOL> arff . BadRelationFormat , <EOL> decoder . _decode_relation , <EOL> fixture <EOL> ) <EOL> fixture = u'<STR_LIT>' <EOL> self . assertRaises ( <EOL> arff . BadRelationFormat , <EOL> decoder . _decode_relation , <EOL> fixture <EOL> ) </s>
