Ejemplo n.º 1
0
class FixedTest(unittest.TestCase):
    """Tests for acme.fields.Fixed."""
    def setUp(self):
        from acme.fields import Fixed
        self.field = Fixed('name', 'x')

    def test_decode(self):
        self.assertEqual('x', self.field.decode('x'))

    def test_decode_bad(self):
        self.assertRaises(jose.DeserializationError, self.field.decode, 'y')

    def test_encode(self):
        self.assertEqual('x', self.field.encode('x'))

    def test_encode_override(self):
        self.assertEqual('y', self.field.encode('y'))
Ejemplo n.º 2
0
class FixedTest(unittest.TestCase):
    """Tests for acme.fields.Fixed."""

    def setUp(self):
        from acme.fields import Fixed
        self.field = Fixed('name', 'x')

    def test_decode(self):
        self.assertEqual('x', self.field.decode('x'))

    def test_decode_bad(self):
        self.assertRaises(jose.DeserializationError, self.field.decode, 'y')

    def test_encode(self):
        self.assertEqual('x', self.field.encode('x'))

    def test_encode_override(self):
        self.assertEqual('y', self.field.encode('y'))
Ejemplo n.º 3
0
 def setUp(self):
     from acme.fields import Fixed
     self.field = Fixed('name', 'x')
Ejemplo n.º 4
0
 def setUp(self):
     from acme.fields import Fixed
     self.field = Fixed('name', 'x')