Skip to content

Commit aab5d76

Browse files
authored
Add kagglehub (#1334)
http://b/314191303
1 parent 823af9a commit aab5d76

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Dockerfile.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ RUN pip install mpld3 \
363363
geoplot \
364364
eli5 \
365365
kaggle \
366+
kagglehub \
366367
mock \
367368
pytest && \
368369
/tmp/clean-layer.sh

tests/test_kagglehub.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
from unittest import mock
3+
4+
import kagglehub
5+
6+
7+
class TestKagglehub(unittest.TestCase):
8+
def test_login(self):
9+
with self.assertLogs('kagglehub', level='INFO') as l:
10+
with mock.patch("builtins.input") as mock_input:
11+
mock_input.side_effect = ["lastplacelarry", "some-key"]
12+
# Disabling credentials validation since network access is disabled in unittest.
13+
kagglehub.login(validate_credentials=False)
14+
15+
self.assertIn("credentials set", l.output[0])

0 commit comments

Comments
 (0)