File: test_default_to_dict_implementation.py

package info (click to toggle)
python-serializable 0.2.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 156 kB
  • sloc: python: 483; makefile: 11
file content (11 lines) | stat: -rw-r--r-- 255 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from serializable import Serializable
from nose.tools import eq_

class A(Serializable):
    def __init__(self, x, y=1):
        self.x = x
        self.y = y

def test_serializable_default_to_dict():
    a = A(10, 1)
    eq_(a, A.from_dict(a.to_dict()))