def test_init_from_str(self): a = InputFileLoaderCheckerSaver() a._attributes = "a b".split() a._initialize_attributes() a.__init__('a=4\nb=6') assert_equal(a.a, 4) assert_equal(a.b, 6) assert_equal(a._input_text, 'a=4\nb=6')
def test_init_from_fileobj(self): a = InputFileLoaderCheckerSaver() a._attributes = "a b".split() a._initialize_attributes() with open(os.path.join(self.tempdir.path, 'inp1.py'), 'r') as f: a.__init__(f) assert_equal(a.a, 4) assert_equal(a.b, 6) assert_equal(a._input_text, 'a=4\nb=6')