forked from datacontract/datacontract-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0245c7f
commit 681868b
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
dataContractSpecification: 0.9.2 | ||
id: "61111-0002" | ||
info: | ||
title: "Verbraucherpreisindex: Deutschland, Monate" | ||
description: A data contract for the distribution and use of the German Consumer Price Index data. | ||
version: 1.0.0 | ||
owner: my-domain-team | ||
models: | ||
verbraucherpreisindex: | ||
description: Model representing the Consumer Price Index for Germany | ||
fields: | ||
wert: | ||
description: Value of the Consumer Price Index | ||
type: bigint # integer | ||
required: true | ||
jahrMonat: | ||
description: Year and month of the data | ||
type: varchar # string | ||
required: true | ||
qualitaet: | ||
description: Quality of the data | ||
type: varchar # string | ||
enum: | ||
- "vorlaeufig" | ||
- "endgueltig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import logging | ||
|
||
from typer.testing import CliRunner | ||
|
||
from datacontract.cli import app | ||
from datacontract.data_contract import DataContract | ||
|
||
runner = CliRunner() | ||
|
||
logging.basicConfig(level=logging.DEBUG, force=True) | ||
|
||
|
||
def test_cli(): | ||
result = runner.invoke(app, ["test", "--examples", "./examples/examples/datacontract_missing.yaml"]) | ||
assert result.exit_code == 1 | ||
|
||
|
||
def test_missing(): | ||
data_contract = DataContract(data_contract_file="examples/examples/datacontract_missing.yaml", examples=True) | ||
run = data_contract.test() | ||
print(run) | ||
print(run.result) | ||
assert run.result == "warning" | ||
|
||
|