original_docstring: Test that the GetFile flow works.
docstring: Test that the GetFile flow works.
docstring_tokens: Test that the GetFile flow works .
code: def testGetFile(self):
      """Test that the GetFile flow works."""
  
      client_mock = action_mocks.ActionMock("TransferBuffer", "StatFile")
      pathspec = rdfvalue.PathSpec(
          pathtype=rdfvalue.PathSpec.PathType.OS,
          path=os.path.join(self.base_path, "test_img.dd"))
  
      for _ in test_lib.TestFlowHelper("GetFile", client_mock, token=self.token,
                                       client_id=self.client_id,
                                       pathspec=pathspec):
        pass
  
      # Fix path for Windows testing.
      pathspec.path = pathspec.path.replace("\\", "/")
      # Test the AFF4 file that was created.
      urn = aff4.AFF4Object.VFSGRRClient.PathspecToURN(pathspec, self.client_id)
      fd1 = aff4.FACTORY.Open(urn, token=self.token)
      fd2 = open(pathspec.path)
      fd2.seek(0, 2)
  
      self.assertEqual(fd2.tell(), int(fd1.Get(fd1.Schema.SIZE)))
      self.CompareFDs(fd1, fd2)
code_tokens: def testGetFile ( self ) : client_mock = action_mocks . ActionMock ( "TransferBuffer" , "StatFile" ) pathspec = rdfvalue . PathSpec ( pathtype = rdfvalue . PathSpec . PathType . OS , path = os . path . join ( self . base_path , "test_img.dd" ) ) for _ in test_lib . TestFlowHelper ( "GetFile" , client_mock , token = self . token , client_id = self . client_id , pathspec = pathspec ) : pass pathspec . path = pathspec . path . replace ( "\\" , "/" ) urn = aff4 . AFF4Object . VFSGRRClient . PathspecToURN ( pathspec , self . client_id ) fd1 = aff4 . FACTORY . Open ( urn , token = self . token ) fd2 = open ( pathspec . path ) fd2 . seek ( 0 , 2 ) self . assertEqual ( fd2 . tell ( ) , int ( fd1 . Get ( fd1 . Schema . SIZE ) ) ) self . CompareFDs ( fd1 , fd2 )
short_docstring: Test that the GetFile flow works.
short_docstring_tokens: Test that the GetFile flow works .
comment: """Test that the GetFile flow works."""$SEP$# Fix path for Windows testing.$SEP$# Test the AFF4 file that was created.