tests: functional and unit tests for analytics

This commit is contained in:
Mr. Outis
2019-11-26 19:29:20 -06:00
parent 6bc24039db
commit f9952046fd
4 changed files with 50 additions and 11 deletions
+14
View File
@@ -0,0 +1,14 @@
import mock
import json
from dvc.main import main
@mock.patch("dvc.analytics.send")
def test_daemon_analytics(mock_send, tmp_path):
report = {"name": "dummy report"}
fname = tmp_path / "report"
fname.write_text(json.dumps(report))
assert 0 == main(["daemon", "analytics", str(fname)])
assert mock_send.called