Google ML - 无法从Google云端存储桶中读取数据

时间:2017-05-09 21:14:44

标签: google-cloud-platform google-cloud-storage google-cloud-ml google-cloud-ml-engine

我已经按照这些说明从谷歌ML引擎中读取谷歌存储桶中的数据。 - https://cloud.google.com/ml-engine/docs/how-tos/working-with-data

但根据上述说明,在将权限分配给我的项目之后,似乎无法从桶中读取我的代码。

这就是代码的样子,显示的错误是无法找到文件

<?php 

use Behat\Behat\Context\Context;;
use Behat\Gherkin\Node\PyStringNode;
use PHPUnit_Framework_TestCase as PHPUnit;
use Behat\MinkExtension\Context\MinkContext;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Behat\Tester\Exception\PendingException;

class BrowserContext extends MinkContext implements Context, SnippetAcceptingContext 
{
    private $baseUrl;

    public function __construct($baseUrl = "http://localhost/") 
    {
        $this->baseUrl = $baseUrl;
    }

    /**
     * @Then An alert modal should show up with:
     */
    public function anAlertModalShouldShowUpWith(PyStringNode $message) 
    {
        //prepare the js script
        //here we are checking if th emodal is visible
        $script = "(function(){return ($('#myModal').is(':visible'));})();";

        //store the result of the js code
        $result = $this->getSession()->evaluateScript($script);

        //check for true with phpunit
        PHPUnit::assertTrue($result);

        //prepare the js script
        //here we are getting all the modal html as a string
        $script = "(function(){return $('#myModal').html();})();";

        //store the result of the js code
        $result = $this->getSession()->evaluateScript($script);

        //check if the string contains our message
        PHPUnit::assertContains($message->getRaw(), $result);
    }
}

1 个答案:

答案 0 :(得分:1)

您不能将open用于GCS上的文件。有关详细信息,请参阅this answer

相关问题