Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit b5c04e0

Browse files
John Andersenpdxjohnny
authored andcommitted
tests: integration: Merge memory to csv
Signed-off-by: John Andersen <[email protected]>
1 parent e437ea5 commit b5c04e0

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Integration tests using the command line interface.
810
### Changed
911
- Features were moved from ModelContext to ModelConfig
1012
- CI is now run via GitHub Actions

tests/test_integration_cli.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
various DFFML classes and constructs.
44
"""
55
import io
6+
import inspect
7+
import pathlib
68
import contextlib
79

810
from dffml.cli.cli import CLI
@@ -67,3 +69,28 @@ async def test_memory_to_json(self):
6769
stdout = self.stdout.getvalue()
6870
for src_url in src_urls:
6971
self.assertIn(src_url, stdout)
72+
73+
async def test_memory_to_csv(self):
74+
src_urls = ["A", "B", "C"]
75+
filename = self.mktempfile()
76+
await CLI.cli(
77+
"merge",
78+
"dest=csv",
79+
"src=memory",
80+
"-source-dest-filename",
81+
filename,
82+
"-source-src-repos",
83+
*src_urls,
84+
)
85+
self.assertEqual(
86+
pathlib.Path(filename).read_text(),
87+
inspect.cleandoc(
88+
"""
89+
src_url,label,prediction,confidence
90+
A,unlabeled,,
91+
B,unlabeled,,
92+
C,unlabeled,,
93+
"""
94+
)
95+
+ "\n",
96+
)

0 commit comments

Comments
 (0)