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

        self.assertEqual(fileobj_name(Foo()), "123")
Exemple #4
0
    def test_fileobj_name_other_type(self):

        class Foo(object):
            name = 123

        self.assertEqual(fileobj_name(Foo()), "123")