Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
API: Fix oui_v3
Browse files Browse the repository at this point in the history
maxmouchet committed Dec 22, 2019
1 parent 4110028 commit b39b63b
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion locomotive/api/oui_v3/client.py
Original file line number Diff line number Diff line change
@@ -127,4 +127,4 @@ def __to_segment(self, obj: dict) -> Segment:
)

def __to_proposal(self, obj: dict) -> Proposal:
return Proposal(flexibility_level=obj["flexibilityLevel"], price=obj["price"])
return Proposal(flexibility_level=obj["info"]["miInfo"]["proposalType"], price=obj["price"]['value'])
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ def test_helper():

def test_search_with_origin_and_destination():
runner = CliRunner()
result = runner.invoke(cli, ["search", "FRBES", "FRPAR"])
result = runner.invoke(cli, ["search", "FRPAR", "FRLYS"])

assert "km) on" in result.output
assert result.exit_code == 0
@@ -50,15 +50,15 @@ def test_search_with_date_provided():

def test_search_with_class_provided():
runner = CliRunner()
result = runner.invoke(cli, ["search", "FRBES", "FRPAR", "--class", "first"])
result = runner.invoke(cli, ["search", "FRPAR", "FRLYS", "--class", "first"])

assert "km) on" in result.output
assert result.exit_code == 0


def test_search_with_formatter_provided():
runner = CliRunner()
result = runner.invoke(cli, ["search", "FRBES", "FRPAR", "--format", "json"])
result = runner.invoke(cli, ["search", "FRPAR", "FRLYS", "--format", "json"])

assert "km) on" in result.output
assert result.exit_code == 0

0 comments on commit b39b63b

Please sign in to comment.