def test_none_at_bottom(self): a=EmptyClass() a.a=None a.b=4 a.d='happy' assert_equal(string_of_object_attributes(a, 'a b c d'.split(), none_at_bottom=False), textwrap.dedent("""\ a = None b = 4 c = None d = 'happy' """))
def test_numpy_array_prefix_none(self): a=EmptyClass() a.a=None a.b=4 a.c = np.array([1,2,3]) a.d='happy' assert_equal(string_of_object_attributes(a, 'a b c d'.split(), numpy_array_prefix = None), textwrap.dedent("""\ b = 4 c = array([1, 2, 3]) d = 'happy' a = None """))
def test_defaults(self): a=EmptyClass() a.a=None a.b=4 a.c = np.array([1,2,3]) a.d='happy' assert_equal(string_of_object_attributes(a, 'a b c d'.split()), textwrap.dedent("""\ b = 4 c = np.array([1, 2, 3]) d = 'happy' a = None """))
def test_numpy_array_prefix_none(self): a=EmptyClass() a.a=None a.b=4 a.c = np.array([1,2,3]) a.d='happy' assert_equal(string_of_object_attributes(a, 'a b c d'.split(), numpy_array_prefix = None), textwrap.dedent("""\ b = 4 c = array([ 1, 2, 3]) d = 'happy' a = None """))
def test_defaults(self): a=EmptyClass() a.a=None a.b=4 a.c = np.array([1,2,3]) a.d='happy' assert_equal(string_of_object_attributes(a, 'a b c d'.split()), textwrap.dedent("""\ b = 4 c = np.array([ 1, 2, 3]) d = 'happy' a = None """))