我已经按照这些说明从谷歌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);
}
}