#!/usr/bin/env python
# -*- coding: utf-8 -*-

##
# hack for loading modules
#
import _path
_path.fix()

##
# python standard library
#
from functools import partial
import unittest

##
# pygrapes modules
#
from pygrapes.serializer import Base


class BaseSerializerTestCase(unittest.TestCase):

    def test_method_dumps_exists(self):
        self.assertTrue(hasattr(Base(), 'dumps'))

    def test_method_dumps_expects_one_arg(self):
        self.assertRaises(TypeError, Base().dumps)

    def test_dumps_method_must_be_implemented(self):
        self.assertRaises(NotImplementedError, partial(Base().dumps, 1))

    def test_method_loads_exists(self):
        self.assertTrue(hasattr(Base(), 'loads'))

    def test_method_loads_expects_one_arg(self):
        self.assertRaises(TypeError, Base().loads)

    def test_loads_method_must_be_implemented(self):
        self.assertRaises(NotImplementedError, partial(Base().loads, 1))


if "__main__" == __name__:
    unittest.main()

@@ -228,20 +228,33 @@
 izer
- import Base
+.abstract import Abstract
 %0A%0A%0Ac
@@ -258,20 +258,24 @@
 %0A%0Aclass 
-Base
+Abstract
 Serializ
@@ -374,28 +374,32 @@
 rue(hasattr(
-Base
+Abstract
 (), 'dumps')
@@ -487,20 +487,24 @@
 eError, 
-Base
+Abstract
 ().dumps
@@ -614,20 +614,24 @@
 partial(
-Base
+Abstract
 ().dumps
@@ -709,20 +709,24 @@
 hasattr(
-Base
+Abstract
 (), 'loa
@@ -818,20 +818,24 @@
 eError, 
-Base
+Abstract
 ().loads
@@ -949,12 +949,16 @@
 ial(
-Base
+Abstract
 ().l

Use abstract.Abstract instead of Base alias when testing pygrapes.serializer.abstract.Abstract class