parameters: (self)
docstring: Test that the command line tool can read PAM file.
docstring_summary: Test that the command line tool can read PAM file.
docstring_tokens: Test that the command line tool can read PAM file .
function: def testPAMin(self):
          """Test that the command line tool can read PAM file."""
          def do():
              return _main(['testPAMin'])
          s = BytesIO()
          s.write(strtobytes('P7\nWIDTH 3\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\n'
                  'TUPLTYPE RGB_ALPHA\nENDHDR\n'))
          # The pixels in flat row flat pixel format
          flat =  [255,0,0,255, 0,255,0,120, 0,0,255,30]
          asbytes = seqtobytes(flat)
          s.write(asbytes)
          s.flush()
          s.seek(0)
          o = BytesIO()
          testWithIO(s, o, do)
          r = Reader(bytes=o.getvalue())
          x,y,pixels,meta = r.read()
          self.assertTrue(r.alpha)
          self.assertTrue(not r.greyscale)
          self.assertEqual(list(itertools.chain(*pixels)), flat)
function_tokens: def testPAMin ( self ) : def do ( ) : return _main ( [ 'testPAMin' ] ) s = BytesIO ( ) s . write ( strtobytes ( 'P7\nWIDTH 3\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\n' 'TUPLTYPE RGB_ALPHA\nENDHDR\n' ) ) # The pixels in flat row flat pixel format flat = [ 255 , 0 , 0 , 255 , 0 , 255 , 0 , 120 , 0 , 0 , 255 , 30 ] asbytes = seqtobytes ( flat ) s . write ( asbytes ) s . flush ( ) s . seek ( 0 ) o = BytesIO ( ) testWithIO ( s , o , do ) r = Reader ( bytes = o . getvalue ( ) ) x , y , pixels , meta = r . read ( ) self . assertTrue ( r . alpha ) self . assertTrue ( not r . greyscale ) self . assertEqual ( list ( itertools . chain ( * pixels ) ) , flat )