forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_init.py
More file actions
27 lines (23 loc) · 919 Bytes
/
Copy pathtest_init.py
File metadata and controls
27 lines (23 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import tempfile
from datetime import datetime, timedelta
from pathlib import Path
from tests.cli_utils import CliRunner
def test_repo_init() -> None:
"""
This test simply makes sure that you can run `feast apply && feast materialize` on
the repo created by "feast init" without errors.
"""
runner = CliRunner()
with tempfile.TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
result = runner.run(["init", "my_project"], cwd=temp_path)
repo_path = temp_path / "my_project"
assert result.returncode == 0
result = runner.run(["apply"], cwd=repo_path)
assert result.returncode == 0
end_date = datetime.utcnow()
start_date = end_date - timedelta(days=100)
result = runner.run(
["materialize", start_date.isoformat(), end_date.isoformat()], cwd=repo_path
)
assert result.returncode == 0