Skip to content

Commit

Permalink
fix: python version and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Github committed Sep 9, 2021
1 parent 268a539 commit d1b7f4f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 66 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ RUN (curl -sL https://deb.nodesource.com/setup_16.x | bash) \
locales \
nodejs \
perl \
python \
python-pip \
python3 \
python3-pip \
ruby-full \
unzip \
zlib1g-dev \
&& pip install docutils==0.14 \
&& pip3 install docutils==0.14 \
&& gem install bundler \
&& rm -rf /var/lib/apt/lists/* \
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"symfony/process": "^5.1"
},
"require-dev": {
"beberlei/assert": "^3.3",
"behat/behat": "^3.5",
"guzzlehttp/guzzle": "^7.2",
"pedrotroller/php-cs-custom-fixer": "^2.15",
"sebastian/diff": "^4.0",
"webmozart/assert": "^1.3"
"sebastian/diff": "^4.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
125 changes: 69 additions & 56 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions features/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Assert\InvalidArgumentException;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Gherkin\Node\PyStringNode;
Expand All @@ -10,7 +11,7 @@
use GuzzleHttp\Exception\ServerException;
use Psr\Http\Message\ResponseInterface;
use SebastianBergmann\Diff\Differ;
use Webmozart\Assert\Assert;
use Assert\Assert;

final class FeatureContext implements Context
{
Expand Down Expand Up @@ -63,13 +64,11 @@ public function iShouldGetTheFollowingHtml(PyStringNode $html): void
throw new Exception('No request sent.');
}

Assert::eq($this->response->getStatusCode(), 200);

try {
Assert::eq(
(string) $this->response->getBody(),
(string) $html,
);
Assert::that($this->response->getStatusCode())
->eq(200);
Assert::that((string) $this->response->getBody())
->eq($html);
} catch (InvalidArgumentException $exception) {
echo (new Differ())->diff(
(string) $html,
Expand All @@ -89,6 +88,7 @@ public function iShouldGetAnUnexpectedMediaTypeHttpResponse(): void
throw new Exception('No request sent.');
}

Assert::eq($this->response->getStatusCode(), 415);
Assert::that($this->response->getStatusCode())
->eq(415);
}
}

0 comments on commit d1b7f4f

Please sign in to comment.