def test_fileobj_name(self): with tempfile.TemporaryFile(mode="rb") as h: self.assertEqual(fileobj_name(h), str(h.name))
def test_fileobj_name(self): with tempfile.TemporaryFile(mode="rb") as h: self.assertEqual(fileobj_name(h), text_type(h.name))
def test_fileobj_name_other_type(self): class Foo(object): name = 123 self.assertEqual(fileobj_name(Foo()), "123")
def test_fileobj_name_other_type(self): class Foo(object): name = 123 self.assertEqual(fileobj_name(Foo()), "123")