<s> from __future__ import absolute_import <EOL> import unittest <EOL> from collections import namedtuple <EOL> from functional . util import ReusableFile , is_namedtuple <EOL> Data = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TestUtil ( unittest . TestCase ) : <EOL> def test_reusable_file ( self ) : <EOL> license_file_lf = ReusableFile ( '<STR_LIT>' ) <EOL> with open ( '<STR_LIT>' ) as license_file : <EOL> self . assertEqual ( list ( license_file ) , list ( license_file_lf ) ) <EOL> iter_1 = iter ( license_file_lf ) <EOL> iter_2 = iter ( license_file_lf ) <EOL> self . assertEqual ( list ( iter_1 ) , list ( iter_2 ) ) <EOL> def test_is_namedtuple ( self ) : <EOL> self . assertTrue ( is_namedtuple ( Data ( <NUM_LIT:1> , <NUM_LIT:2> ) ) ) <EOL> self . assertFalse ( is_namedtuple ( ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) ) <EOL> self . assertFalse ( is_namedtuple ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) ) <EOL> self . assertFalse ( is_namedtuple ( <NUM_LIT:1> ) ) </s>
